无法在 ubuntu 上安装 Ta-lib - pip 和 make [重复] 错误
Posted
技术标签:
【中文标题】无法在 ubuntu 上安装 Ta-lib - pip 和 make [重复] 错误【英文标题】:Unable to install Ta-lib on ubuntu - error with pip and make [duplicate] 【发布时间】:2018-08-21 02:37:41 【问题描述】:我已经尝试了一些替代方法,但是当我发送时,我无法在我的 ubuntu 上安装 ta-lib 或使用 make
pip install ta-Lib
Collecting ta-Lib
Using cached https://files.pythonhosted.org/packages/90/05/d4c6a778d7a7de0be366bc4a850b4ffaeac2abad927f95fa8ba6f355a082/TA-Lib-0.4.17.tar.gz
Requirement already satisfied: numpy in ./miniconda3/lib/python3.6/site-packages (from ta-Lib) (1.15.0)
Building wheels for collected packages: ta-Lib
Running setup.py bdist_wheel for ta-Lib ... error
Complete output from command /home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugk06wz4/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/pip-wheel-v2gctt6z --python-tag cp36:
/tmp/pip-install-ugk06wz4/ta-Lib/setup.py:79: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/talib
copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
copying talib/__init__.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_pandas.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/talib
gcc -pthread -B /home/user/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/home/user/miniconda3/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
talib/_ta_lib.c:526: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
----------------------------------------
Failed building wheel for ta-Lib
Running setup.py clean for ta-Lib
Failed to build ta-Lib
Installing collected packages: ta-Lib
Running setup.py install for ta-Lib ... error
Complete output from command /home/user/miniconda3/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ugk06wz4/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 /tmp/pip-record-kipfzx36/install-record.txt --single-version-externally-managed --compile:
/tmp/pip-install-ugk06wz4/ta-Lib/setup.py:79: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/talib
copying talib/stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/deprecated.py -> build/lib.linux-x86_64-3.6/talib
copying talib/abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_stream.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_abstract.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_data.py -> build/lib.linux-x86_64-3.6/talib
copying talib/__init__.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_pandas.py -> build/lib.linux-x86_64-3.6/talib
copying talib/test_func.py -> build/lib.linux-x86_64-3.6/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/talib
gcc -pthread -B /home/user/miniconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/user/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/home/user/miniconda3/include/python3.6m -c talib/_ta_lib.c -o build/temp.linux-x86_64-3.6/talib/_ta_lib.o
talib/_ta_lib.c:526: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
----------------------------------------
最后是红色的 命令
/home/user/miniconda3/bin/python -u -c "导入设置工具, tokenize;文件='/tmp/pip-install-ugk06wz4/ta-Lib/setup.py';f=getattr(tokenize, 'open', open)(文件);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" 安装 --record /tmp/pip-record-kipfzx36/install-record.txt --single-version-externally-managed --compile" 失败,错误代码 1 在 /tmp/pip-install-ugk06wz4/ta-Lib/
当我输入
make
或者
sudo make install
我明白了:
make: *** 没有使目标“安装”的规则。停下来。
我做错了什么? 在此先感谢您的好意
【问题讨论】:
如果某个问题被标记为重复问题,请将 cmets 中的链接复制到该重复问题。 【参考方案1】:sudo pip install -U setuptools
或者如果引用他的评论不起作用:
Try this 'sudo -H pip install TA-Lib'
【讨论】:
当我尝试 sudo pip install -U setuptools 我得到:“pip command not found”但我有 pip 和更新版本 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip -build-5pUn4a/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 /tmp/pip-YtSAsJ-record/ install-record.txt --single-version-externally-managed --compile" 失败,错误代码 1 在 /tmp/pip-build-5pUn4a/TA-Lib/ Here's another solution that works on linux and mac以上是关于无法在 ubuntu 上安装 Ta-lib - pip 和 make [重复] 错误的主要内容,如果未能解决你的问题,请参考以下文章
安装TA-Lib时报错:ubuntu****, Command "/usr/bin/python -u -c "import setuptools, tokenize;__file