2017-07-31 64 views
1

我试图在Ubuntu安装Python的Ta-Lib的,但是当我运行安装TA-库:无法在Ubuntu

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" failed with error code 1 in /tmp/pip-build-YfCSFn/TA-Lib/ 

我已经安装:

sudo apt-get install python3-dev 

和安装的Ta-lib中

我该如何解决这个问题?

+1

'/ usr/bin/python'通常意味着python2。您可能需要'sudo apt install python-dev' –

回答

1

好像其他人一样有this problem

引述接受的答案:

Seems that your PiP can't access Setuptools as per the "import setuptools" in the error. Try the below first then try running your pip install again.

> sudo pip install -U setuptools 

或者,如果它不工作引述他的评论:

Try this 'sudo -H pip install TA-Lib'

正如菲利普Ferminiano在评论说,如果这仍然没有按” t修复它然后你可以尝试什么在this link上说。

要再次引用公认的答案:

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 

or by doing the following (in bash):

alias sudo='sudo env PATH=$PATH' 
sudo python setup.py install 

这里的问题he's talking about

请给予信贷,如果它解决您的问题接受的答案之一。

+0

这对我而言没有任何作用 –

+0

这是为每个点安装还是只为这个? –

+0

只为这一个。 –