25
我使用的是Ubuntu 12.04,并且希望与python 2.7并排使用python 3.4。Python 3.4和2.7:无法安装numpy软件包python 3.4
python 3.4安装正常。但是,我无法安装python 3的numpy包(因此我无法安装scipy,pandas等)。
使用
sudo pip3 install numpy
吐出以下错误:
File "numpy/core/setup.py", line 289, in check_types
"Cannot compile 'Python.h'. Perhaps you need to "\
SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
顺便说一句,我已经安装的python-dev的。
此外,通过
sudo apt-get install python-numpy
安装numpy的无法正常工作或因为我已经安装numpy的为Python 2.7和安装程序回应说numpy的已经是最新的。
我该怎么办?谢谢!
对于那些在2015年以类似的查询到达的人(与我一样)需要将上述命令更改为“apt-get install python3.5-dev”。 – tschoppi
对于将来的任何人:调整命令以适合您当前的Python版本。是的,Ubuntu不会阅读你的想法或日历。 :-P –
或者你可以使用 'apt-get install python3-dev' 和ubuntu会读你的想法并为你的Ubuntu版本安装正确的版本。 –