Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在聚宽中执行报错 #159

Open
JungleWolfz opened this issue Jul 22, 2022 · 1 comment
Open

在聚宽中执行报错 #159

JungleWolfz opened this issue Jul 22, 2022 · 1 comment

Comments

@JungleWolfz
Copy link

我是采用 !pip3 install xalpha --user 的方式安装的,然后这里总是报错。xalpha有交流群吗,可以进群交流吗
import sys
sys.path.insert(0, "/home/jquser/.local/lib/python3.6/site-packages")
import xalpha as xa
xa.provider.set_jq_data(debug=True)
xa.PEBHistory("SH000990").summary()

报错信息:
`ImportErrorTraceback (most recent call last)
in ()
1 import sys
2 sys.path.insert(0, "/home/jquser/.local/lib/python3.6/site-packages")
----> 3 import xalpha as xa
4 xa.provider.set_jq_data(debug=True)
5 xa.PEBHistory("SH000990").summary()

/home/jquser/.local/lib/python3.6/site-packages/xalpha/init.py in ()
3 name = "xalpha"
4
----> 5 import xalpha.policy
6 import xalpha.remain
7 import xalpha.misc

/home/jquser/.local/lib/python3.6/site-packages/xalpha/policy.py in ()
5 import pandas as pd
6
----> 7 from xalpha.cons import myround, opendate, yesterdaydash, convert_date
8 from xalpha.record import record
9

/home/jquser/.local/lib/python3.6/site-packages/xalpha/cons.py in ()
12 import requests
13 from functools import wraps
---> 14 from simplejson.errors import JSONDecodeError
15
16 import pandas as pd

ImportError: No module named errors`

@refraction-ray
Copy link
Owner

暂时没有交流群,有什么问题都欢迎在 issue 里交流。

看报错是导入 xalpha 时就报错了,似乎原因是 simplejson 不含 errors module,但是我测试了最新版的 simplejson 并没发生 API 改变,好像没这个问题。你在本地安装导入 xalpha 会出现问题吗,或者你在聚宽试一下这个

import simplejson
print(simplejson.__version__)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants