Python can';t安装scipy-冻结在";正在为scipy运行setup.py安装;

Python can';t安装scipy-冻结在";正在为scipy运行setup.py安装;,python,scipy,pip,Python,Scipy,Pip,当我跑的时候 sudo pip install -U scipy 它首先被下载,然后继续显示 Running setup.py install for scipy 但它冻结在那里。我试着升级pip本身。很好。我的pip版本是1.5.4 我得到的唯一错误是不安全的PlatforWarning。完整的输出如下所示: tom@tom-ThinkPad-Edge-E430:~$ sudo pip install -U scipy The directory '/home/tom/.cache/pip

当我跑的时候

sudo pip install -U scipy
它首先被下载,然后继续显示

Running setup.py install for scipy
但它冻结在那里。我试着升级pip本身。很好。我的pip版本是1.5.4

我得到的唯一错误是不安全的PlatforWarning。完整的输出如下所示:

tom@tom-ThinkPad-Edge-E430:~$ sudo pip install -U scipy
The directory '/home/tom/.cache/pip/http' or its parent directory
is not owned by the current user and the cache has been disabled.
Please check the permissions and owner of that directory. If
executing pip with sudo, you may want sudo's -H flag.
The directory '/home/tom/.cache/pip' or its parent directory is not
owned by the current user and caching wheels has been disabled.
check the permissions and owner of that directory. If executing pip with
sudo, you may want sudo's -H flag.
Collecting scipy
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and
may cause certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading scipy-0.16.1.tar.gz (12.2MB)
   100% |████████████████████████████████| 12.2MB 32kB/s 
Installing collected packages: scipy
   Running setup.py install for scipy

这花了出乎意料的长时间,但几分钟后就结束了。所以问题解决了。

sudo apt-get install python-scipy
用于蟒蛇2


如果你不在乎版本。在RPI3上几秒钟内安装

将交换大小从100M增加到1024M解决了Raspberry Pi 3和1G RAM上的问题。仍然需要很长时间(~1h),但不再冻结


(在上找到此提示)

您等待了多长时间?scipy附带了很多C/C++/Fortran扩展,这些扩展可能需要很长时间才能编译。您可以使用
~$pip install-v scipy
显示编译器消息。是的,您是对的。它花了几分钟,但现在已经完成了。当你安装
sklearn
same时也会发生同样的情况-安装大约需要4-5分钟。这可能是我投过的最简单的答案。但是查看一下
top
显示cc1plus的CPU利用率为100%,所以我认为编译工作很辛苦。我花了大约10分钟——2018年2月21日——我的Raspberry Pi已经运行了一个多小时,CPU利用率为5%,所以这实际上可能是一个bug。对我来说,它需要3个多小时才能完成。
sudo apt-get install python3-scipy