python - 在 Ubuntu 11.10 的 virtualenv 中安装 `numpy`

标签 python numpy package virtualenv pip

我在使用 easy_install numpy 安装 numpy 时出现以下异常,有人可以帮忙吗?无论我使用的是 pip 还是 easy_install,我都遇到了同样的问题。很难理解出了什么问题。

non-existing path in 'numpy/core': 'build/src.linux-x86_64-2.7/numpy/core/src/multiarray'
non-existing path in 'numpy/core': 'build/src.linux-x86_64-2.7/numpy/core/src/umath'
numpy/core/src/multiarray/scalartypes.c.src:2549:1: warning: ‘longlong_arrtype_hash’ defined but not used [-Wunused-function]
numpy/core/src/multiarray/mapping.c:74:1: warning: ‘_array_ass_item’ defined but not used [-Wunused-function]
build/src.linux-x86_64-2.7/numpy/core/include/numpy/__ufunc_api.h:226:1: warning: ‘_import_umath’ defined but not used [-Wunused-function]
gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
numpy/core/src/multiarray/scalartypes.c.src:2549:1: warning: ‘longlong_arrtype_hash’ defined but not used [-Wunused-function]
numpy/core/src/multiarray/mapping.c:74:1: warning: ‘_array_ass_item’ defined but not used [-Wunused-function]
build/src.linux-x86_64-2.7/numpy/core/include/numpy/__ufunc_api.h:226:1: warning: ‘_import_umath’ defined but not used [-Wunused-function]
gcc: internal compiler error: Killed (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
error: Setup script exited with error: Command "gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -Inumpy/core/include -Ibuild/src.linux-x86_64-2.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/usr/include/python2.7 -Ibuild/src.linux-x86_64-2.7/numpy/core/src/multiarray -Ibuild/src.linux-x86_64-2.7/numpy/core/src/umath -c numpy/core/src/multiarray/multiarraymodule_onefile.c -o build/temp.linux-x86_64-2.7/numpy/core/src/multiarray/multiarraymodule_onefile.o" failed with exit status 4
/tmp/easy_install-l43x51/numpy-1.6.1/numpy/distutils/misc_util.py:252: RuntimeWarning: Parent module 'numpy.distutils' not found while handling absolute import
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/tmp/easy_install-l43x51/numpy-1.6.1/numpy/distutils/misc_util.py", line 252, in clean_up_temporary_directory
ImportError: No module named numpy.distutils
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/tmp/easy_install-l43x51/numpy-1.6.1/numpy/distutils/misc_util.py", line 252, in clean_up_temporary_directory
ImportError: No module named numpy.distutils

最佳答案

可能 GCC 没有更新。我刚刚做了一个 apt-get upgrade gccnumpy 编译成功。

关于python - 在 Ubuntu 11.10 的 virtualenv 中安装 `numpy`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10511646/

相关文章:

python - 删除 Pyspark 数据框

python - 如何在 MultiIndexed Datarfame 中对一个索引大于 X 的所有值求和,并根据其他索引进行分组?

python - 您最初选择机器学习算法/进行初始设置的经验法则是什么?

python - Numpy 数组赋值

r - 有没有办法避免每次在 R 中安装软件包?

r - DEoptim包中步长参数解释

r - 应该在函数之前还是在函数内部加载数据集?

Python - pandas ==> WINDOW 聚合

python - 更改散点图标记粗细

python - 选择 3d ndarray 中的第一列