如何在 Watson Studio 中安装 'C' 依赖项 ta-lib?
How to install the 'C' dependency ta-lib within Watson Studio?
在 IBM Cloud Watson Studio 中的 Jupyter notebook 的一个单元格中,我尝试了:
%pip install TA-Lib
导致错误:
...
Building wheel for TA-Lib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /opt/conda/envs/Python-3.7-main/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/wsuser/pip-install-xhysmya0/TA-Lib/setup.py'"'"'; __file__='"'"'/tmp/wsuser/pip-install-xhysmya0/TA-Lib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/wsuser/pip-wheel-kmjrdwg6
cwd: /tmp/wsuser/pip-install-xhysmya0/TA-Lib/
Complete output (27 lines):
/tmp/wsuser/pip-install-xhysmya0/TA-Lib/setup.py:71: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
...
gcc -pthread -B /opt/conda/envs/Python-3.7-main/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/conda/envs/Python-3.7-main/lib/python3.7/site-packages/numpy/core/include -I/opt/conda/envs/Python-3.7-main/include/python3.7m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.7/talib/_ta_lib.o
talib/_ta_lib.c:611:10: fatal error: ta-lib/ta_defs.h: No such file or directory
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for TA-Lib
- 在 Watson Studio 中安装'C' 依赖项 的方法是什么?
ta-lib
和依赖项 libta-lib
都可以从 conda-forge 获得。不幸的是,当您从 Watson Studio 笔记本使用 conda-forge 通道时,conda 需要很长时间才能解决环境问题。要快速安装,请使用直接下载 URL。在撰写本文时,那将是:
!conda install https://anaconda.org/conda-forge/libta-lib/0.4.0/download/linux-64/libta-lib-0.4.0-h516909a_0.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/ta-lib-0.4.19-py37ha21ca33_2.tar.bz2
有关更新或其他 Python 版本,请在此处查看:
在 IBM Cloud Watson Studio 中的 Jupyter notebook 的一个单元格中,我尝试了:
%pip install TA-Lib
导致错误:
...
Building wheel for TA-Lib (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /opt/conda/envs/Python-3.7-main/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/wsuser/pip-install-xhysmya0/TA-Lib/setup.py'"'"'; __file__='"'"'/tmp/wsuser/pip-install-xhysmya0/TA-Lib/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/wsuser/pip-wheel-kmjrdwg6
cwd: /tmp/wsuser/pip-install-xhysmya0/TA-Lib/
Complete output (27 lines):
/tmp/wsuser/pip-install-xhysmya0/TA-Lib/setup.py:71: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
...
gcc -pthread -B /opt/conda/envs/Python-3.7-main/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/opt/conda/envs/Python-3.7-main/lib/python3.7/site-packages/numpy/core/include -I/opt/conda/envs/Python-3.7-main/include/python3.7m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.7/talib/_ta_lib.o
talib/_ta_lib.c:611:10: fatal error: ta-lib/ta_defs.h: No such file or directory
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for TA-Lib
- 在 Watson Studio 中安装'C' 依赖项 的方法是什么?
ta-lib
和依赖项 libta-lib
都可以从 conda-forge 获得。不幸的是,当您从 Watson Studio 笔记本使用 conda-forge 通道时,conda 需要很长时间才能解决环境问题。要快速安装,请使用直接下载 URL。在撰写本文时,那将是:
!conda install https://anaconda.org/conda-forge/libta-lib/0.4.0/download/linux-64/libta-lib-0.4.0-h516909a_0.tar.bz2 https://conda.anaconda.org/conda-forge/linux-64/ta-lib-0.4.19-py37ha21ca33_2.tar.bz2
有关更新或其他 Python 版本,请在此处查看: