我正在尝试在 Ubuntu 14.04.4 LTS 上安装 scipy 包,只是因为 gensim 需要它,使用 pip (在有人插话切换到其他 12 个 python 包管理器中的任何一个之前:否)。我已经安装了所有先决条件包:
- Python 2.7
- libblas3
- liblapack3
- 海湾合作委员会
- gfortran
- python-dev
- libc6
- libatlas-base
- libatlas-dev
- python-build-essential
当我运行 pip install gensim 时,我收到大约十分钟的编译器警告,然后是几个虚拟内存耗尽:无法分配内存
错误。不断出现的编译器警告之一是:
/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
有什么想法为什么会发生这种情况吗?
最佳答案
事实证明,需要将 pip 本身升级到最新版本:pip install --upgrade pip
。完成后,scipy 安装没有问题。
关于python - scipy 的 PIP 安装在 Ubuntu 14.04 上严重失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38987322/