2012-05-09 170 views
6

當使用easy_install numpy安裝numpy時,我得到了以下例外,有人可以幫忙嗎?無論我使用的是pip還是easy_install,我都遇到了同樣的問題。很難理解發生了什麼問題。在Ubuntu 11.10的virtualenv中安裝'numpy`

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 
+1

我覺得'gcc:內部編譯器錯誤:殺死(程序cc1)'是關鍵點。看起來你需要提交一個錯誤報告。 – talonmies

+0

我只是做一個'apt-get upgrade gcc',現在一切正常。謝謝。 – hllau

+0

@hilau你可以添加到答案。 – pcx

回答

8

也許海灣合作委員會沒有更新。我只是做了apt-get upgrade gccnumpy編譯成功。

+1

你最終得到了什麼版本的gcc?我有gcc 4.6.3,我仍然看到錯誤。 – davidgoli

2

您只需使用此命令而不是easy_install。爲我工作

sudo apt-get install python-numpy python-scipy 
+1

謝謝。我通常在'virtualenv'中安裝軟件包,所以在開發幾個項目時我不會污染全局命名空間。喜歡'easy_install'。 – hllau

+0

@hllau你可以upvote我的答案,如果你發現它有用:) – gauravmunjal

+12

'apt-get install'不會在virtualenv中安裝軟件包。我不想污染全球環境。 – hllau