pip install numpy退出时出现错误,但仍然安装

时间:2019-10-19 18:50:23

标签: numpy pip raspberry-pi fedora lapack

我想用fedora30和python 3.7.3在树莓派上的virtualenv中安装numpy。我输入了pip install numpy,过了一会儿,它产生了一条巨大的错误消息,该错误消息的一部分似乎与lapack / blas有关,同时仍然安装了一些numpy。我不确定在这种情况下我是否可以相信任何numpy的结果,并希望获得有关避免构建错误的建议。当包含sys/endian.h时,该版本会报告一个致命错误。

我安装了与通常在带fedora30的x64计算机上安装的系统软件包相同的系统软件包,在这些计算机上我通常可以顺利运行pip install numpy。在树莓上做对我来说是新的。

我试图寻找一种提供endian.hdnf provides endian.hdnf provides sys/endian.h并没有运气的软件包。

在我的virtualenv中运行pip install numpy会导致在stderr上显示非常大的错误消息,并在stdout上显示以下文本:


    Collecting numpy
      Downloading https://files.pythonhosted.org/packages/b6/d6/be8f975f5322336f62371c9abeb936d592c98c047ad63035f1b38ae08efe/numpy-1.17.3.zip (6.4MB)
    Building wheels for collected packages: numpy
      Building wheel for numpy (setup.py): started
      Building wheel for numpy (setup.py): still running...
      Building wheel for numpy (setup.py): still running...
    ...
      Building wheel for numpy (setup.py): still running...
      Building wheel for numpy (setup.py): finished with status 'error'
      Running setup.py clean for numpy
    Failed to build numpy
    Installing collected packages: numpy
        Running setup.py install for numpy: started
        Running setup.py install for numpy: still running...
    ...
        Running setup.py install for numpy: still running...
        Running setup.py install for numpy: finished with status 'done'
    Successfully installed numpy-1.17.3

错误消息的长度为189352字节,我希望在下面传达相关信息:


      ERROR: Command errored out with exit status 1:
       command: /home/examiner/projects/rekenlab_test/venv/rekenlab/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uke3fxog/numpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uke3fxog/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-q3wtyuey --python-tag cp37
           cwd: /tmp/pip-install-uke3fxog/numpy/
      Complete output (2777 lines):
      Running from numpy source directory.
      blas_opt_info:
      blas_mkl_info:
      customize UnixCCompiler
        libraries mkl_rt not found in ['/home/examiner/projects/rekenlab_test/venv/rekenlab/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
        NOT AVAILABLE

      blis_info:
      customize UnixCCompiler
        libraries blis not found in ['/home/examiner/projects/rekenlab_test/venv/rekenlab/lib', '/usr/local/lib64', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/']
        NOT AVAILABLE

    ...

      /bin/sh: svnversion: command not found

    ...

      atlas_3_10_threads_info:
      Setting PTATLAS=ATLAS
      customize UnixCCompiler
        libraries lapack_atlas not found in /home/examiner/projects/rekenlab_test/venv/rekenlab/lib
      customize UnixCCompiler
        libraries tatlas,tatlas not found in /home/examiner/projects/rekenlab_test/venv/rekenlab/lib

    ...

      customize UnixCCompiler
        libraries tatlas,tatlas not found in /usr/lib/
      
        NOT AVAILABLE

    ...

      Could not locate executable g95
      customize PathScaleFCompiler
      Could not locate executable pathf95
      customize NAGFORCompiler
      Could not locate executable nagfor
      don't know how to compile Fortran code on platform 'posix'
      C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

    ...

      compile options: '-Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/home/examiner/installed/python3.7.3/usr/local/include/python3.7m -c'
      gcc: _configtest.c
      _configtest.c:1:10: fatal error: sys/endian.h: No such file or directory
          1 | #include <sys/endian.h>
            |          ^~~~~~~~~~~~~~
      compilation terminated.
      failure.
      removing: _configtest.c _configtest.o
      C compiler: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC

    ...

      _configtest.c:1:10: fatal error: emmintrin.h: No such file or directory
          1 | #include <emmintrin.h>
            |          ^~~~~~~~~~~~~
    ...
      numpy/linalg/lapack_lite/f2c_blas.c: In function ‘zgemm_’:
      numpy/linalg/lapack_lite/f2c_blas.c:15670:20: warning: variable ‘ncola’ set but not used [-Wunused-but-set-variable]
      15670 |     static integer ncola;
            |                    ^~~~~
      gcc: numpy/linalg/lapack_lite/f2c_config.c
      gcc: numpy/linalg/lapack_lite/f2c.c
      error: Command "gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Inumpy/core/include -Ibuild/src.linux-aarch64-3.7/numpy/core/include/numpy -Inumpy/core/src/common -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/home/examiner/installed/python3.7.3/usr/local/include/python3.7m -Ibuild/src.linux-aarch64-3.7/numpy/core/src/common -Ibuild/src.linux-aarch64-3.7/numpy/core/src/npymath -Ibuild/src.linux-aarch64-3.7/numpy/core/src/common -Ibuild/src.linux-aarch64-3.7/numpy/core/src/npymath -c numpy/linalg/lapack_lite/f2c_d_lapack.c -o build/temp.linux-aarch64-3.7/numpy/linalg/lapack_lite/f2c_d_lapack.o -MMD -MF build/temp.linux-aarch64-3.7/numpy/linalg/lapack_lite/f2c_d_lapack.o.d" failed with exit status 1
      ----------------------------------------
      ERROR: Failed building wheel for numpy
      ERROR: Command errored out with exit status 1:
       command: /home/examiner/projects/rekenlab_test/venv/rekenlab/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-uke3fxog/numpy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-uke3fxog/numpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
           cwd: /tmp/pip-install-uke3fxog/numpy
      Complete output (10 lines):
      Running from numpy source directory.

      `setup.py clean` is not supported, use one of the following instead:

        - `git clean -xdf` (cleans all files)
        - `git clean -Xdf` (cleans all versioned files, doesn't touch
                            files that aren't checked into the git repo)

      Add `--force` to your command to use it anyway if you must (unsupported).

      ----------------------------------------
      ERROR: Failed cleaning build dir for numpy

pip语句似乎已经安装了某些东西,尽管看起来好像很麻木:


    $ python
    Python 3.7.3 (default, Oct 15 2019, 15:38:35) 
    [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import numpy as np
    >>> a = np.array((1,2,3))
    >>> a + 1
    array([2, 3, 4])

问题:如果自己的构建失败,pip最终会安装什么?我可以在这种状态下依靠numpy结果吗?我该怎么做才能消除构建错误?

我安装了与通常在x64计算机上安装的系统软件包相同的系统软件包,但是也许raspberry-pi需要显式安装其他软件包吗?

谢谢您的建议!

0 个答案:

没有答案