掘金社区

调用 from gm.api import * 报错Pinned highlighted

michael 2 发表在策略研究 2021-05-13 00:48:03

策略研究
315
1
0

我的环境是python 3.6,下面是安装列表

(ml) PS C:\Projects\python\stock> pip list
Package Version


arrow 1.1.0
astroid 2.5.6
colorama 0.4.4
Cython 0.29.23
gm 3.0.134
grpcio 1.37.1
isort 5.8.0
joblib 1.0.1
lazy-object-proxy 1.6.0
mccabe 0.6.1
numpy 1.19.5
pandas 1.1.5
pip 21.1.1
protobuf 3.16.0
pylint 2.8.2
python-dateutil 2.8.1
pytz 2021.1
scikit-learn 0.24.2
scipy 1.5.4
setuptools 28.8.0
six 1.16.0
threadpoolctl 2.1.0
toml 0.10.2
typed-ast 1.4.3
typing-extensions 3.10.0.0
wrapt 1.12.1

列表显示gm已安装,但我在运行程序时报一下错误:

(ml) PS C:\Projects\python\stock> python svm_demo.py
Traceback (most recent call last):
File "svm_demo.py", line 5, in <module>
from gm.api import *
File "C:\Projects\python\ml\lib\site-packages\gm\api_init_.py", line 10, in <module>
from gm.model.storage import Context
File "C:\Projects\python\ml\lib\site-packages\gm\model_init_.py", line 6, in <module>
from typing import NoReturn, Text, Optional
ImportError: cannot import name 'NoReturn'

请问如何解决

评论: 1
  • 请确认系统环境变量里面的.../python/script路径与.../python路径一致。

    2021-05-13 09:10:39

Looks like your connection to 掘金量化社区 - 量化交易者的交流社区 was lost, please wait while we try to reconnect.