2013-12-10 127 views
9

失敗當我嘗試:與PIP安裝NumPy的Ubuntu上

$ sudo pip install numpy 

我的Ubuntu 12.04服務器上,我得到:

------------------------------------------------------------ 
/usr/local/bin/pip run on Tue Dec 10 18:25:54 2013 
Downloading/unpacking numpy 

    Getting page https://pypi.python.org/simple/numpy/ 
    URLs to search for versions for numpy: 
    * https://pypi.python.org/simple/numpy/ 
    Analyzing links from page https://pypi.python.org/simple/numpy/ 
    Skipping link https://pypi.python.org/packages/2.4/n/numpy/numpy-1.0.1.dev3460.win32-py2.4.exe#md5=a55b13b1f141de2aa965d5c5554c4ad8 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Skipping link https://pypi.python.org/packages/2.5/n/numpy/numpy-1.3.0.win32-py2.5.exe#md5=28ee6681b04beb5bfc4bc056417ff087 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Skipping link https://pypi.python.org/packages/2.5/n/numpy/numpy-1.5.1.win32-py2.5-nosse.exe#md5=bfcb66706ebdece6a9680f79f2b643ca (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Skipping link https://pypi.python.org/packages/2.5/n/numpy/numpy-1.6.0.win32-py2.5.exe#md5=539782c7311d4a3379f66a964159ef11 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    [ ...SNIP...] 
    Skipping link https://pypi.python.org/packages/3.2/n/numpy/numpy-1.6.1.win32-py3.2.exe#md5=a6b66602e72436db37e6edbbce269fdf (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Skipping link https://pypi.python.org/packages/3.2/n/numpy/numpy-1.6.2.win32-py3.2.exe#md5=b98cc04b20347127e297a99b6114b514 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Skipping link https://pypi.python.org/packages/3.2/n/numpy/numpy-1.7.0.win32-py3.2.exe#md5=1b12834a53d3ba543d41399c40b5b791 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Skipping link https://pypi.python.org/packages/3.2/n/numpy/numpy-1.7.1.win32-py3.2.exe#md5=651465cacf107d254ddcefcebb47064d (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Skipping link https://pypi.python.org/packages/3.3/n/numpy/numpy-1.7.0.win32-py3.3.exe#md5=4f20740e7e9d31a9d4c1636a931bc3f9 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Skipping link https://pypi.python.org/packages/3.3/n/numpy/numpy-1.7.1.win32-py3.3.exe#md5=6519c7bb198d0caf2913469883a63be9 (from https://pypi.python.org/simple/numpy/); unknown archive format: .exe 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.3.0.tar.gz#md5=3f7773ff0971a5ebb8591536d8ec7bd6 (from https://pypi.python.org/simple/numpy/), version: 1.3.0 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.4.1.tar.gz#md5=89b8a56e018b634f7d05c56f17bc4943 (from https://pypi.python.org/simple/numpy/), version: 1.4.1 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.5.0.tar.gz#md5=3a8bfdc434df782d647161c48943ee09 (from https://pypi.python.org/simple/numpy/), version: 1.5.0 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.5.1.tar.gz#md5=376ef150df41b5353944ab742145352d (from https://pypi.python.org/simple/numpy/), version: 1.5.1 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.0.tar.gz#md5=e0993c74cb8e83292e560eac1a9be8e9 (from https://pypi.python.org/simple/numpy/), version: 1.6.0 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.0.zip#md5=f0ce7ea1a12b3b3480571980af243e48 (from https://pypi.python.org/simple/numpy/), version: 1.6.0 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.1.tar.gz#md5=2bce18c08fc4fce461656f0f4dd9103e (from https://pypi.python.org/simple/numpy/), version: 1.6.1 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.1.zip#md5=462c22b8eb221c78ddd51de98fbb5979 (from https://pypi.python.org/simple/numpy/), version: 1.6.1 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.2.tar.gz#md5=95ed6c9dcc94af1fc1642ea2a33c1bba (from https://pypi.python.org/simple/numpy/), version: 1.6.2 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.6.2.zip#md5=7e13c931985f90efcfa0408f845d6fee (from https://pypi.python.org/simple/numpy/), version: 1.6.2 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.7.0.tar.gz#md5=4fa54e40b6a243416f0248123b6ec332 (from https://pypi.python.org/simple/numpy/), version: 1.7.0 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.7.0.zip#md5=ca27913c59393940e880fab420f985b4 (from https://pypi.python.org/simple/numpy/), version: 1.7.0 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.7.1.tar.gz#md5=0ab72b3b83528a7ae79c6df9042d61c6 (from https://pypi.python.org/simple/numpy/), version: 1.7.1 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.7.1.zip#md5=9a72db3cad7a6286c0d22ee43ad9bc6c (from https://pypi.python.org/simple/numpy/), version: 1.7.1 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.8.0.tar.gz#md5=2a4b0423a758706d592abb6721ec8dcd (from https://pypi.python.org/simple/numpy/), version: 1.8.0 
    Found link https://pypi.python.org/packages/source/n/numpy/numpy-1.8.0.zip#md5=6c918bb91c0cfa055b16b13850cfcd6e (from https://pypi.python.org/simple/numpy/), version: 1.8.0 
    Using version 1.8.0 (newest of versions: 1.8.0, 1.8.0, 1.7.1, 1.7.1, 1.7.0, 1.7.0, 1.6.2, 1.6.2, 1.6.1, 1.6.1, 1.6.0, 1.6.0, 1.5.1, 1.5.0, 1.4.1, 1.3.0) 
    Downloading from URL https://pypi.python.org/packages/source/n/numpy/numpy-1.8.0.tar.gz#md5=2a4b0423a758706d592abb6721ec8dcd (from https://pypi.python.org/simple/numpy/) 
    Running setup.py egg_info for package numpy 

    Running from numpy source directory. 

    /bin/sh: 1: svnversion: not found 

    non-existing path in 'numpy/distutils': 'site.cfg' 

    F2PY Version 2 

    blas_opt_info: 

    blas_mkl_info: 

     libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib'] 

     NOT AVAILABLE 



    openblas_info: 

     libraries openblas not found in ['/usr/local/lib', '/usr/lib'] 

     NOT AVAILABLE 



    atlas_blas_threads_info: 

    Setting PTATLAS=ATLAS 

     libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib'] 

     NOT AVAILABLE 



    atlas_blas_info: 

     libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib'] 

     NOT AVAILABLE 



    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1522: UserWarning: 

     Atlas (http://math-atlas.sourceforge.net/) libraries not found. 

     Directories to search for the libraries can be specified in the 

     numpy/distutils/site.cfg file (section [atlas]) or by setting 

     the ATLAS environment variable. 

     warnings.warn(AtlasNotFoundError.__doc__) 

    blas_info: 

     libraries blas not found in ['/usr/local/lib', '/usr/lib'] 

     NOT AVAILABLE 



    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1531: UserWarning: 

     Blas (http://www.netlib.org/blas/) libraries not found. 

     Directories to search for the libraries can be specified in the 

     numpy/distutils/site.cfg file (section [blas]) or by setting 

     the BLAS environment variable. 

     warnings.warn(BlasNotFoundError.__doc__) 

    blas_src_info: 

     NOT AVAILABLE 



    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1534: UserWarning: 

     Blas (http://www.netlib.org/blas/) sources not found. 

     Directories to search for the sources can be specified in the 

     numpy/distutils/site.cfg file (section [blas_src]) or by setting 

     the BLAS_SRC environment variable. 

     warnings.warn(BlasSrcNotFoundError.__doc__) 

     NOT AVAILABLE 



    /bin/sh: 1: svnversion: not found 

    non-existing path in 'numpy/lib': 'benchmarks' 

    lapack_opt_info: 

    lapack_mkl_info: 

    mkl_info: 

     libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib'] 

     NOT AVAILABLE 



     NOT AVAILABLE 



    atlas_threads_info: 

    Setting PTATLAS=ATLAS 

     libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib 

     libraries lapack_atlas not found in /usr/local/lib 

     libraries ptf77blas,ptcblas,atlas not found in /usr/lib 

     libraries lapack_atlas not found in /usr/lib 

    numpy.distutils.system_info.atlas_threads_info 

     NOT AVAILABLE 



    atlas_info: 

     libraries f77blas,cblas,atlas not found in /usr/local/lib 

     libraries lapack_atlas not found in /usr/local/lib 

     libraries f77blas,cblas,atlas not found in /usr/lib 

     libraries lapack_atlas not found in /usr/lib 

    numpy.distutils.system_info.atlas_info 

     NOT AVAILABLE 



    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1428: UserWarning: 

     Atlas (http://math-atlas.sourceforge.net/) libraries not found. 

     Directories to search for the libraries can be specified in the 

     numpy/distutils/site.cfg file (section [atlas]) or by setting 

     the ATLAS environment variable. 

     warnings.warn(AtlasNotFoundError.__doc__) 

    lapack_info: 

     libraries lapack not found in ['/usr/local/lib', '/usr/lib'] 

     NOT AVAILABLE 



    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1439: UserWarning: 

     Lapack (http://www.netlib.org/lapack/) libraries not found. 

     Directories to search for the libraries can be specified in the 

     numpy/distutils/site.cfg file (section [lapack]) or by setting 

     the LAPACK environment variable. 

     warnings.warn(LapackNotFoundError.__doc__) 

    lapack_src_info: 

     NOT AVAILABLE 



    /tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1442: UserWarning: 

     Lapack (http://www.netlib.org/lapack/) sources not found. 

     Directories to search for the sources can be specified in the 

     numpy/distutils/site.cfg file (section [lapack_src]) or by setting 

     the LAPACK_SRC environment variable. 

     warnings.warn(LapackSrcNotFoundError.__doc__) 

     NOT AVAILABLE 



    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'define_macros' 

     warnings.warn(msg) 

    running egg_info 
    running build_src 
    build_src 

    building py_modules sources 

    creating build 
    creating build/src.linux-x86_64-2.7 
    creating build/src.linux-x86_64-2.7/numpy 
    creating build/src.linux-x86_64-2.7/numpy/distutils 
    building library "npymath" sources 

    customize Gnu95FCompiler 

    Could not locate executable gfortran 

    Could not locate executable f95 

    customize IntelFCompiler 

    Could not locate executable ifort 

    Could not locate executable ifc 

    customize LaheyFCompiler 

    Could not locate executable lf95 

    customize PGroupFCompiler 

    Could not locate executable pgfortran 

    customize AbsoftFCompiler 

    Could not locate executable f90 

    Could not locate executable f77 

    customize NAGFCompiler 

    customize VastFCompiler 

    customize CompaqFCompiler 

    Could not locate executable fort 

    customize IntelItaniumFCompiler 

    Could not locate executable efort 

    Could not locate executable efc 

    customize IntelEM64TFCompiler 

    customize GnuFCompiler 

    Could not locate executable g77 

    customize G95FCompiler 

    Could not locate executable g95 

    customize PathScaleFCompiler 

    Could not locate executable pathf95 

    don't know how to compile Fortran code on platform 'posix' 

    C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC 



    compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/usr/include/python2.7 -c' 

    gcc: _configtest.c 

    sh: 1: gcc: not found 

    sh: 1: gcc: not found 

    failure. 

    removing: _configtest.c _configtest.o 

    Traceback (most recent call last): 

     File "<string>", line 16, in <module> 

     File "/tmp/pip_build_root/numpy/setup.py", line 192, in <module> 

     setup_package() 

     File "/tmp/pip_build_root/numpy/setup.py", line 185, in setup_package 

     configuration=configuration) 

     File "/tmp/pip_build_root/numpy/numpy/distutils/core.py", line 169, in setup 

     return old_setup(**new_attr) 

     File "/usr/lib/python2.7/distutils/core.py", line 152, in setup 

     dist.run_commands() 

     File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands 

     self.run_command(cmd) 

     File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command 

     cmd_obj.run() 

     File "/tmp/pip_build_root/numpy/numpy/distutils/command/egg_info.py", line 10, in run 

     self.run_command("build_src") 

     File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command 

     self.distribution.run_command(command) 

     File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command 

     cmd_obj.run() 

     File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 153, in run 

     self.build_sources() 

     File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 164, in build_sources 

     self.build_library_sources(*libname_info) 

     File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 299, in build_library_sources 

     sources = self.generate_sources(sources, (lib_name, build_info)) 

     File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 386, in generate_sources 

     source = func(extension, build_dir) 

     File "numpy/core/setup.py", line 674, in get_mathlib_info 

     raise RuntimeError("Broken toolchain: cannot link a simple C program") 

    RuntimeError: Broken toolchain: cannot link a simple C program 

    Complete output from command python setup.py egg_info: 

    Running from numpy source directory. 

/bin/sh: 1: svnversion: not found 

non-existing path in 'numpy/distutils': 'site.cfg' 

F2PY Version 2 

blas_opt_info: 

blas_mkl_info: 

    libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib'] 

    NOT AVAILABLE 



openblas_info: 

    libraries openblas not found in ['/usr/local/lib', '/usr/lib'] 

    NOT AVAILABLE 



atlas_blas_threads_info: 

Setting PTATLAS=ATLAS 

    libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib'] 

    NOT AVAILABLE 



atlas_blas_info: 

    libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib'] 

    NOT AVAILABLE 



/tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1522: UserWarning: 

    Atlas (http://math-atlas.sourceforge.net/) libraries not found. 

    Directories to search for the libraries can be specified in the 

    numpy/distutils/site.cfg file (section [atlas]) or by setting 

    the ATLAS environment variable. 

    warnings.warn(AtlasNotFoundError.__doc__) 

blas_info: 

    libraries blas not found in ['/usr/local/lib', '/usr/lib'] 

    NOT AVAILABLE 



/tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1531: UserWarning: 

    Blas (http://www.netlib.org/blas/) libraries not found. 

    Directories to search for the libraries can be specified in the 

    numpy/distutils/site.cfg file (section [blas]) or by setting 

    the BLAS environment variable. 

    warnings.warn(BlasNotFoundError.__doc__) 

blas_src_info: 

    NOT AVAILABLE 



/tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1534: UserWarning: 

    Blas (http://www.netlib.org/blas/) sources not found. 

    Directories to search for the sources can be specified in the 

    numpy/distutils/site.cfg file (section [blas_src]) or by setting 

    the BLAS_SRC environment variable. 

    warnings.warn(BlasSrcNotFoundError.__doc__) 

    NOT AVAILABLE 



/bin/sh: 1: svnversion: not found 

non-existing path in 'numpy/lib': 'benchmarks' 

lapack_opt_info: 

lapack_mkl_info: 

mkl_info: 

    libraries mkl,vml,guide not found in ['/usr/local/lib', '/usr/lib'] 

    NOT AVAILABLE 



    NOT AVAILABLE 



atlas_threads_info: 

Setting PTATLAS=ATLAS 

    libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib 

    libraries lapack_atlas not found in /usr/local/lib 

    libraries ptf77blas,ptcblas,atlas not found in /usr/lib 

    libraries lapack_atlas not found in /usr/lib 

numpy.distutils.system_info.atlas_threads_info 

    NOT AVAILABLE 



atlas_info: 

    libraries f77blas,cblas,atlas not found in /usr/local/lib 

    libraries lapack_atlas not found in /usr/local/lib 

    libraries f77blas,cblas,atlas not found in /usr/lib 

    libraries lapack_atlas not found in /usr/lib 

numpy.distutils.system_info.atlas_info 

    NOT AVAILABLE 



/tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1428: UserWarning: 

    Atlas (http://math-atlas.sourceforge.net/) libraries not found. 

    Directories to search for the libraries can be specified in the 

    numpy/distutils/site.cfg file (section [atlas]) or by setting 

    the ATLAS environment variable. 

    warnings.warn(AtlasNotFoundError.__doc__) 

lapack_info: 

    libraries lapack not found in ['/usr/local/lib', '/usr/lib'] 

    NOT AVAILABLE 



/tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1439: UserWarning: 

    Lapack (http://www.netlib.org/lapack/) libraries not found. 

    Directories to search for the libraries can be specified in the 

    numpy/distutils/site.cfg file (section [lapack]) or by setting 

    the LAPACK environment variable. 

    warnings.warn(LapackNotFoundError.__doc__) 

lapack_src_info: 

    NOT AVAILABLE 



/tmp/pip_build_root/numpy/numpy/distutils/system_info.py:1442: UserWarning: 

    Lapack (http://www.netlib.org/lapack/) sources not found. 

    Directories to search for the sources can be specified in the 

    numpy/distutils/site.cfg file (section [lapack_src]) or by setting 

    the LAPACK_SRC environment variable. 

    warnings.warn(LapackSrcNotFoundError.__doc__) 

    NOT AVAILABLE 



/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'define_macros' 

    warnings.warn(msg) 

running egg_info 

running build_src 

build_src 

building py_modules sources 

creating build 

creating build/src.linux-x86_64-2.7 

creating build/src.linux-x86_64-2.7/numpy 

creating build/src.linux-x86_64-2.7/numpy/distutils 

building library "npymath" sources 

customize Gnu95FCompiler 

Could not locate executable gfortran 

Could not locate executable f95 

customize IntelFCompiler 

Could not locate executable ifort 

Could not locate executable ifc 

customize LaheyFCompiler 

Could not locate executable lf95 

customize PGroupFCompiler 

Could not locate executable pgfortran 

customize AbsoftFCompiler 

Could not locate executable f90 

Could not locate executable f77 

customize NAGFCompiler 

customize VastFCompiler 

customize CompaqFCompiler 

Could not locate executable fort 

customize IntelItaniumFCompiler 

Could not locate executable efort 

Could not locate executable efc 

customize IntelEM64TFCompiler 

customize GnuFCompiler 

Could not locate executable g77 

customize G95FCompiler 

Could not locate executable g95 

customize PathScaleFCompiler 

Could not locate executable pathf95 

don't know how to compile Fortran code on platform 'posix' 

C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC 



compile options: '-Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -Inumpy/core/include -I/usr/include/python2.7 -c' 

gcc: _configtest.c 

sh: 1: gcc: not found 

sh: 1: gcc: not found 

failure. 

removing: _configtest.c _configtest.o 

Traceback (most recent call last): 

    File "<string>", line 16, in <module> 

    File "/tmp/pip_build_root/numpy/setup.py", line 192, in <module> 

    setup_package() 

    File "/tmp/pip_build_root/numpy/setup.py", line 185, in setup_package 

    configuration=configuration) 

    File "/tmp/pip_build_root/numpy/numpy/distutils/core.py", line 169, in setup 

    return old_setup(**new_attr) 

    File "/usr/lib/python2.7/distutils/core.py", line 152, in setup 

    dist.run_commands() 

    File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands 

    self.run_command(cmd) 

    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command 

    cmd_obj.run() 

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/egg_info.py", line 10, in run 

    self.run_command("build_src") 

    File "/usr/lib/python2.7/distutils/cmd.py", line 326, in run_command 

    self.distribution.run_command(command) 

    File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command 

    cmd_obj.run() 

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 153, in run 

    self.build_sources() 

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 164, in build_sources 

    self.build_library_sources(*libname_info) 

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 299, in build_library_sources 

    sources = self.generate_sources(sources, (lib_name, build_info)) 

    File "/tmp/pip_build_root/numpy/numpy/distutils/command/build_src.py", line 386, in generate_sources 

    source = func(extension, build_dir) 

    File "numpy/core/setup.py", line 674, in get_mathlib_info 

    raise RuntimeError("Broken toolchain: cannot link a simple C program") 

RuntimeError: Broken toolchain: cannot link a simple C program 

---------------------------------------- 

Cleaning up... 

    Removing temporary dir /tmp/pip_build_root... 
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/numpy 

Exception information: 
Traceback (most recent call last): 
    File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 134, in main 
    status = self.run(options, args) 
    File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 236, in run 
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) 
    File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 1134, in prepare_files 
    req_to_install.run_egg_info() 
    File "/usr/local/lib/python2.7/dist-packages/pip/req.py", line 259, in run_egg_info 
    command_desc='python setup.py egg_info') 
    File "/usr/local/lib/python2.7/dist-packages/pip/util.py", line 670, in call_subprocess 
    % (command_desc, proc.returncode, cwd)) 
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/numpy 

我不知道我需要做什麼來解決這個問題。最終,我將能夠將我需要的所有依賴關係放在requirements.txt文件中,以便我可以在virtualenv中安裝發現。考慮到這一點,我寧願使用pip而不是apt-get或從源代碼進行安裝。

+0

你喜歡'pip'的具體原因是什麼? 'apt-get'是爲您的系統量身定製的,因此會安裝最適合環境/操作系統的版本。 – Evert

+1

@JamesMills我不同意 - 我發現NumPy的構建指令很差且不一致。 – YXD

+0

@MrE對不起,這不是我的經驗。也許這些年來我做了很多。 –

回答

22

看起來你的系統沒有gcc

安裝使用下面的命令編譯工具:

apt-get install build-essential python-dev 
9

pip不會爲你安裝必要的編譯器。

如果你只是想numpy的,並不需要經過點子,使用

sudo apt-get install python-numpy 

,你會得到所有的必要條件,以及(如python-dev)。

+3

不幸的是,Ubuntu軟件包通常是過時的... – YXD

+1

有一臺服務器(這是12.04服務器,如果我正確的話是LTS),它的整體意義在於:它可能因速度而過時(Python,numpy等)的開發,但作爲一個完整的系統,它應該是非常穩定的。手動升級軟件包可以達到某個程度,然後事情可以迅速下降。 – Evert

7

一些軟件包可能並不需要(沒有時間詳細檢查),但在我的安裝腳本安裝NumPy的堆棧我第一次安裝Ubuntu的下包:

- build-essential 
- gfortran 
- libatlas-base-dev 
- libatlas3gf-base 
- python-dev 
- libjpeg-dev 
- libxml2-dev 
- libfreetype6-dev 
- libpng-dev 

否則,你可以簡單地使用Anaconda Python發行版,這很好。

0

我曾經得到幾乎相同類型的錯誤,但使用虛擬環境解決它。有很多環境,但我個人建議venv。

我能夠使用venv輕鬆擺脫錯誤。

這是因爲使用sudo加載操作系統上的所有庫是不合適的。 您的操作系統變得很大並且出現不必要的錯誤。