问题描述
我正在尝试在 Ubuntu 中安装 Python Ta-Lib,但是当我运行时:
pip install TA-Lib
我收到此错误:
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YfCSFn/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-swmI7D-record/install-record.txt --single-version-externally-managed --compile" 在/tmp/pip-build-YfCSFn/中失败,错误代码为 1TA-Lib/
我已经安装了:
sudo apt-get install python3-dev
并安装了 Ta-lib
我该如何解决这个问题?
看起来像其他人一样 这个问题.
引用已接受的答案:
似乎您的画中画无法根据导入setuptools" 中的错误.首先尝试以下操作,然后尝试运行您的再次pip安装.
>须藤 pip install -U setuptools
或者如果引用他的评论不起作用:
试试这个'sudo -H pip install TA-Lib'
正如 Filipe Ferminiano 在评论中所说,如果这仍然不能解决问题,那么您可以尝试 此链接 .
再次引用接受的答案:
你的 sudo 没有得到正确的 python.这是 sudo 在 Ubuntu 中的已知行为.有关更多信息,请参阅此问题.您需要确保 sudo 调用正确的 python,或者使用完整路径:须藤/usr/local/epd/bin/python setup.py 安装
或通过执行以下操作(在 bash 中):
alias sudo='sudo env PATH=$PATH'须藤 python setup.py 安装
这是他在谈论的问题
如果它解决了您的问题,请感谢已接受的答案之一.
I'm trying to install Python Ta-Lib in Ubuntu,but when I run:
pip install TA-Lib
I get this error:
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-YfCSFn/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-swmI7D-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-YfCSFn/TA-Lib/
I already installed:
sudo apt-get install python3-dev
and installed Ta-lib
How can I fix this?
Seem like other people had this problem.
To quote the accepted answer:
> sudo pip install -U setuptools
Or if it doesn't work to quote his comment:
As Filipe Ferminiano said in comment if this still doesn't fix it then you can try what is said on this link .
To quote the accepted answer once again:
Your sudo is not getting the right python. This is a known behaviour of sudo in Ubuntu. See this question for more info. You need to make sure that sudo calls the right python, either by using the full path:
sudo /usr/local/epd/bin/python setup.py install
alias sudo='sudo env PATH=$PATH'
sudo python setup.py install
Here is the question he's talking about
Please give credit to the one of the accepted answer if it fix your problem.
这篇关于无法在 Ubuntu 上安装 TA-Lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!