问题描述
在 Visual Studio 代码版本中尝试使用 cmd 时:1.53.2(用户设置)
铬:87.0.4280.141
Node.js:12.18.3
操作系统:Windows_NT x64 10.0.19041
Python 版本 3.9.2..
这是我的错误,我已经停了一天了..请帮忙,谢谢开发者
ERROR: Command errored out with exit status 1: 'c:\users\cash\coinview\.venv\scripts\python.exe' -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'C:\\Users\\CASH\\AppData\\Local\\Temp\\pip-install-zjh5g7bp\\ta-lib\\setup.py'"'"'; __file__='"'"'C:\\Users\\CASH\\AppData\\Local\\Temp\\pip-install-zjh5g7bp\\ta-lib\\setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' install --record 'C:\Users\CASH\AppData\Local\Temp\pip-record-jzlcw_4l\install-record.txt' --single-version-externally-managed --compile --install-headers
'c:\users\cash\coinview\.venv\include\site\python3.9\TA-Lib' Check the logs for full command output.
解决方法
您需要先安装 ta-lib native library,然后才能安装将 Python API 添加到该库的 Python 模块。
在安装本机库之前,我尝试在 Mac 上安装此模块。我得到了一个非常相似的错误:
ERROR: Command errored out with exit status 1: /Users/steve/envs/foo/bin/python -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/private/var/folders/y2/84p16ph920x6j2g2glfb52pw0000gp/T/pip-install-U7_tLW/ta-lib/setup.py'"'"'; __file__='"'"'/private/var/folders/y2/84p16ph920x6j2g2glfb52pw0000gp/T/pip-install-U7_tLW/ta-lib/setup.py'"'"';f=getattr(tokenize,'"'"'open'"'"',open)(__file__);code=f.read().replace('"'"'\r\n'"'"','"'"'\n'"'"');f.close();exec(compile(code,__file__,'"'"'exec'"'"'))' install --record /private/var/folders/y2/84p16ph920x6j2g2glfb52pw0000gp/T/pip-record-OIbYo6/install-record.txt --single-version-externally-managed --compile --install-headers /Users/steve/envs/foo/include/site/python2.7/TA-Lib Check the logs for full command output.
然后我做到了:
brew install ta-lib
安装本机库。这样做之后,Python 库的安装就正常了。
我不懂Windows,所以不能告诉你如何安装本机库。然而,这似乎很可能是您问题的解决方案,就像我的问题一样。