我试图在Ubuntu 14.04.4 LTS上安装scipy软件包,只是因为gensim需要它,使用pip(在任何人切换到其他12个python软件包管理器中的任何一个之前:No)。我已经安装了所有的prereq包:
当我运行pip install gensim时,我得到大约十分钟的编译器警告,然后是几个virtual memory exhausted: Cannot allocate memory
错误。不断出现的编译器警告之一是:
/home/ubuntu/www/cool-project/venv/local/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
^
尽管安装了numpy,但仍然存在:
(venv)ubuntu@box:~/www/cool-project$ pip install numpy --upgrade
Requirement already up-to-date: numpy in ./venv/lib/python2.7/site-packages
Cleaning up...
最后,最后一条错误消息:
error: Command "c++ -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -fPIC -D__STDC_FORMAT_MACROS=1 -Iscipy/sparse/sparsetools -I/home/ubuntu/www/cool-project/venv/local/lib/python2.7/site-packages/numpy/core/include -I/usr/include/python2.7 -c scipy/sparse/sparsetools/bsr.cxx -o build/temp.linux-x86_64-2.7/scipy/sparse/sparsetools/bsr.o" failed with exit status 1
为什么会发生这种情况?
答案 0 :(得分:2)
事实证明,所需要的是将pip本身升级到最新版本:pip install --upgrade pip
。完成之后,scipy安装没有问题。