简体   繁体   中英

pip install numpy fails (python 2.7 on Artik 710 board (Fedora))

I'm installing numpy through pip on Samsung Artik 710 (Fedora and Python 2.7). pip version is 9.0.1.

I have inputted as following:

pip install numpy 

However I get the following the error message:

Collecting numpy
  Using cached numpy-1.12.1.zip
Installing collected packages: numpy
  Running setup.py install for numpy ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-XyASFu/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-sHmAWz-record/install-record.txt --single-version-externally-managed --compile:
    Running from numpy source directory.

    Note: if you need reliable uninstall behavior, then install
    with pip instead of using `setup.py install`:

      - `pip install .`       (from a git repo or downloaded source
                               release)
      - `pip install numpy`   (last NumPy release on PyPi)


    blas_opt_info:
    blas_mkl_info:
      libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    blis_info:
      libraries blis not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    openblas_info:
      libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    atlas_3_10_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas not found in ['/usr/local/lib', '/usr/lib/sse2', '/usr/lib', '/usr/lib/sse2', '/usr/lib/']
      NOT AVAILABLE

    atlas_3_10_blas_info:
      libraries satlas not found in ['/usr/local/lib', '/usr/lib/sse2', '/usr/lib', '/usr/lib/sse2', '/usr/lib/']
      NOT AVAILABLE

    atlas_blas_threads_info:
    Setting PTATLAS=ATLAS
      libraries ptf77blas,ptcblas,atlas not found in ['/usr/local/lib', '/usr/lib/sse2', '/usr/lib', '/usr/lib/sse2', '/usr/lib/']
      NOT AVAILABLE

    atlas_blas_info:
      libraries f77blas,cblas,atlas not found in ['/usr/local/lib', '/usr/lib/sse2', '/usr/lib', '/usr/lib/sse2', '/usr/lib/']
      NOT AVAILABLE

    /tmp/pip-build-XyASFu/numpy/numpy/distutils/system_info.py:572: 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.
      self.calc_info()
    blas_info:
      libraries blas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    /tmp/pip-build-XyASFu/numpy/numpy/distutils/system_info.py:572: 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.
      self.calc_info()
    blas_src_info:
      NOT AVAILABLE

    /tmp/pip-build-XyASFu/numpy/numpy/distutils/system_info.py:572: 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.
      self.calc_info()
      NOT AVAILABLE

    /bin/sh: svnversion: command not found
    non-existing path in 'numpy/distutils': 'site.cfg'
    /bin/sh: svnversion: command not found
    F2PY Version 2
    lapack_opt_info:
    lapack_mkl_info:
      libraries mkl_rt not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    openblas_lapack_info:
      libraries openblas not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    atlas_3_10_threads_info:
    Setting PTATLAS=ATLAS
      libraries tatlas,tatlas not found in /usr/local/lib
      libraries lapack_atlas not found in /usr/local/lib
      libraries tatlas,tatlas not found in /usr/lib/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries tatlas,tatlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib
      libraries tatlas,tatlas not found in /usr/lib/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries tatlas,tatlas not found in /usr/lib/
      libraries lapack_atlas not found in /usr/lib/
    <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
      NOT AVAILABLE

    atlas_3_10_info:
      libraries satlas,satlas not found in /usr/local/lib
      libraries lapack_atlas not found in /usr/local/lib
      libraries satlas,satlas not found in /usr/lib/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries satlas,satlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib
      libraries satlas,satlas not found in /usr/lib/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries satlas,satlas not found in /usr/lib/
      libraries lapack_atlas not found in /usr/lib/
    <class 'numpy.distutils.system_info.atlas_3_10_info'>
      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/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries ptf77blas,ptcblas,atlas not found in /usr/lib/
      libraries lapack_atlas not found in /usr/lib/
    <class '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/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries f77blas,cblas,atlas not found in /usr/lib
      libraries lapack_atlas not found in /usr/lib
      libraries f77blas,cblas,atlas not found in /usr/lib/sse2
      libraries lapack_atlas not found in /usr/lib/sse2
      libraries f77blas,cblas,atlas not found in /usr/lib/
      libraries lapack_atlas not found in /usr/lib/
    <class 'numpy.distutils.system_info.atlas_info'>
      NOT AVAILABLE

    lapack_info:
      libraries lapack not found in ['/usr/local/lib', '/usr/lib', '/usr/lib/']
      NOT AVAILABLE

    /tmp/pip-build-XyASFu/numpy/numpy/distutils/system_info.py:572: 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.
      self.calc_info()
    lapack_src_info:
      NOT AVAILABLE

    /tmp/pip-build-XyASFu/numpy/numpy/distutils/system_info.py:572: 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.
      self.calc_info()
      NOT AVAILABLE

    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'define_macros'
      warnings.warn(msg)
    running install
    running build
    running config_cc
    unifing config_cc, config, build_clib, build_ext, build commands --compiler options
    running config_fc
    unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
    running build_src
    build_src
    building py_modules sources
    creating build
    creating build/src.linux-armv7l-2.7
    creating build/src.linux-armv7l-2.7/numpy
    creating build/src.linux-armv7l-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 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -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 -I/usr/include/python2.7 -c'
    gcc: _configtest.c
    gcc -pthread _configtest.o -o _configtest
    success!
    removing: _configtest.c _configtest.o _configtest
    C compiler: gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -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 -I/usr/include/python2.7 -c'
    gcc: _configtest.c
    _configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
     int exp (void);
         ^~~
    gcc -pthread _configtest.o -o _configtest
    _configtest.o: In function `main':
    /tmp/pip-build-XyASFu/numpy/_configtest.c:6: undefined reference to `exp'
    collect2: error: ld returned 1 exit status
    _configtest.o: In function `main':
    /tmp/pip-build-XyASFu/numpy/_configtest.c:6: undefined reference to `exp'
    collect2: error: ld returned 1 exit status
    failure.
    removing: _configtest.c _configtest.o
    C compiler: gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -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 -I/usr/include/python2.7 -c'
    gcc: _configtest.c
    _configtest.c:1:5: warning: conflicting types for built-in function ‘exp’
     int exp (void);
         ^~~
    gcc -pthread _configtest.o -lm -o _configtest
    success!
    removing: _configtest.c _configtest.o _configtest
    creating build/src.linux-armv7l-2.7/numpy/core
    creating build/src.linux-armv7l-2.7/numpy/core/src
    creating build/src.linux-armv7l-2.7/numpy/core/src/npymath
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/npymath/npy_math.c
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/npymath/ieee754.c
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/npymath/npy_math_complex.c
    building library "npysort" sources
    creating build/src.linux-armv7l-2.7/numpy/core/src/npysort
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/npysort/quicksort.c
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/npysort/mergesort.c
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/npysort/heapsort.c
    creating build/src.linux-armv7l-2.7/numpy/core/src/private
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/private/npy_partition.h
      adding 'build/src.linux-armv7l-2.7/numpy/core/src/private' to include_dirs.
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/npysort/selection.c
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/private/npy_binsearch.h
    conv_template:> build/src.linux-armv7l-2.7/numpy/core/src/npysort/binsearch.c
    None - nothing done with h_files = ['build/src.linux-armv7l-2.7/numpy/core/src/private/npy_partition.h', 'build/src.linux-armv7l-2.7/numpy/core/src/private/npy_binsearch.h']
    building extension "numpy.core._dummy" sources
    Generating build/src.linux-armv7l-2.7/numpy/core/include/numpy/config.h
    C compiler: gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=hard -D_GNU_SOURCE -fPIC -fwrapv -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 -I/usr/include/python2.7 -c'
    gcc: _configtest.c
    _configtest.c:1:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    _configtest.c:1:20: fatal error: Python.h: No such file or directory
     #include <Python.h>
                        ^
    compilation terminated.
    failure.
    removing: _configtest.c _configtest.o
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-XyASFu/numpy/setup.py", line 391, in <module>
        setup_package()
      File "/tmp/pip-build-XyASFu/numpy/setup.py", line 383, in setup_package
        setup(**metadata)
      File "/tmp/pip-build-XyASFu/numpy/numpy/distutils/core.py", line 169, in setup
        return old_setup(**new_attr)
      File "/usr/lib/python2.7/distutils/core.py", line 151, 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-XyASFu/numpy/numpy/distutils/command/install.py", line 62, in run
        r = self.setuptools_run()
      File "/tmp/pip-build-XyASFu/numpy/numpy/distutils/command/install.py", line 36, in setuptools_run
        return distutils_install.run(self)
      File "/usr/lib/python2.7/distutils/command/install.py", line 563, in run
        self.run_command('build')
      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-XyASFu/numpy/numpy/distutils/command/build.py", line 47, in run
        old_build.run(self)
      File "/usr/lib/python2.7/distutils/command/build.py", line 127, in run
        self.run_command(cmd_name)
      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-XyASFu/numpy/numpy/distutils/command/build_src.py", line 148, in run
        self.build_sources()
      File "/tmp/pip-build-XyASFu/numpy/numpy/distutils/command/build_src.py", line 165, in build_sources
        self.build_extension_sources(ext)
      File "/tmp/pip-build-XyASFu/numpy/numpy/distutils/command/build_src.py", line 324, in build_extension_sources
        sources = self.generate_sources(sources, ext)
      File "/tmp/pip-build-XyASFu/numpy/numpy/distutils/command/build_src.py", line 377, in generate_sources
        source = func(extension, build_dir)
      File "numpy/core/setup.py", line 416, in generate_config_h
        moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
      File "numpy/core/setup.py", line 40, in check_types
        out = check_types(*a, **kw)
      File "numpy/core/setup.py", line 275, in check_types
        "install {0}-dev|{0}-devel.".format(python))
    SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-XyASFu/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-sHmAWz-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-XyASFu/numpy/

Please help me. Thank you.

It looks like you're missing the python-devel package in your operating system - this is often required by Python packages that use compiled C code for performance, like numpy.

Try running yum install python-devel - if that works, retry pip install numpy .

on your system libblas is not installed and possibly other libraries like liblapack , libatlas . depending on what os you are try

sudo yum install blas-devel lapack-devel

sudo apt-get install gcc gfortran python-dev libblas-dev liblapack-dev cython

https://www.scipy.org/scipylib/building/linux.html

What is the easiest way to install BLAS and LAPACK for scipy?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM