簡體   English   中英

Python 模塊安裝錯誤,當我嘗試 pip numpy

[英]Python module install error when I tried to pip numpy

當我使用python -m pip install numpy==1.18.1命令安裝numpy lib 時,出現以下錯誤。

ramirami-pc:anomalydetector sclee01$ python -m pip install numpy==1.18.1
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Collecting numpy==1.18.1
  Using cached numpy-1.18.1.zip (5.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: numpy
  Building wheel for numpy (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for numpy (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [705 lines of output]
      /private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-install-sh2vo79x/numpy_2f275be08abf460d9f7ebbc831c5ddb7/tools/cythonize.py:75: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        required_version = LooseVersion('0.29.14')
      /private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-install-sh2vo79x/numpy_2f275be08abf460d9f7ebbc831c5ddb7/tools/cythonize.py:77: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cython_version) < required_version:
      numpy/random/_bounded_integers.pxd.in has not changed
      numpy/random/_philox.pyx has not changed
      numpy/random/_bit_generator.pyx has not changed
      numpy/random/_bounded_integers.pyx.in has not changed
      numpy/random/_sfc64.pyx has not changed
      numpy/random/_mt19937.pyx has not changed
      Processing numpy/random/_bounded_integers.pyx
      numpy/random/mtrand.pyx has not changed
      numpy/random/_generator.pyx has not changed
      numpy/random/_pcg64.pyx has not changed
      numpy/random/_common.pyx has not changed
      Cythonizing sources
      blas_opt_info:
      blas_mkl_info:
      customize UnixCCompiler
      .........
      C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
      
      creating build/temp.macosx-12-arm64-cpython-38
      creating build/temp.macosx-12-arm64-cpython-38/numpy
      creating build/temp.macosx-12-arm64-cpython-38/numpy/core
      creating build/temp.macosx-12-arm64-cpython-38/numpy/core/src
      creating build/temp.macosx-12-arm64-cpython-38/numpy/core/src/npymath
      creating build/temp.macosx-12-arm64-cpython-38/build
      creating build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8
      creating build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8/numpy
      creating build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8/numpy/core
      creating build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8/numpy/core/src
      creating build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8/numpy/core/src/npymath
      compile options: '-Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -Inumpy/core/include -Ibuild/src.macosx-12-arm64-3.8/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/opt/homebrew/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/include/python3.8 -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -c'
      clang: numpy/core/src/npymath/npy_math.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npymath/ieee754.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npymath/npy_math_complex.c
      clang: numpy/core/src/npymath/halffloat.c
      In file included from numpy/core/src/npymath/npy_math.c:9:
      numpy/core/src/npymath/npy_math_internal.h.src:490:21: warning: incompatible pointer types passing 'npy_longdouble *' (aka 'double *') to parameter of type 'long double *' [-Wincompatible-pointer-types]
          return modfl(x, iptr);
                          ^~~~
      /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/math.h:394:52: note: passing argument to parameter here
      extern long double modfl(long double, long double *);
                                                         ^
      1 warning generated.
      ar: adding 4 object files to build/temp.macosx-12-arm64-cpython-38/libnpymath.a
      ranlib:@ build/temp.macosx-12-arm64-cpython-38/libnpymath.a
      building 'npysort' library
      compiling C sources
      C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
      
      creating build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8/numpy/core/src/npysort
      compile options: '-Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-12-arm64-3.8/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/opt/homebrew/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/include/python3.8 -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -c'
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npysort/quicksort.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npysort/mergesort.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npysort/timsort.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npysort/heapsort.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npysort/radixsort.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npysort/selection.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/npysort/binsearch.c
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      numpy/core/src/npysort/selection.c.src:328:9: warning: code will never be executed [-Wunreachable-code]
              npy_intp k;
              ^~~~~~~~~~~
      numpy/core/src/npysort/selection.c.src:326:14: note: silence by adding parentheses to mark code as explicitly dead
          else if (0 && kth == num - 1) {
                   ^
                   /* DISABLES CODE */ ( )
      22 warnings generated.
      ar: adding 7 object files to build/temp.macosx-12-arm64-cpython-38/libnpysort.a
      ranlib:@ build/temp.macosx-12-arm64-cpython-38/libnpysort.a
      running build_ext
      customize UnixCCompiler
      customize UnixCCompiler using new_build_ext
      building 'numpy.core._multiarray_tests' extension
      compiling C sources
      C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
      
      creating build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8/numpy/core/src/multiarray
      creating build/temp.macosx-12-arm64-cpython-38/numpy/core/src/common
      compile options: '-DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.macosx-12-arm64-3.8/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/opt/homebrew/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/include/python3.8 -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -c'
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/multiarray/_multiarray_tests.c
      clang: numpy/core/src/common/mem_overlap.c
      In file included from numpy/core/src/multiarray/_multiarray_tests.c.src:7:
      In file included from numpy/core/include/numpy/npy_math.h:643:
      numpy/core/src/npymath/npy_math_internal.h.src:490:21: warning: incompatible pointer types passing 'npy_longdouble *' (aka 'double *') to parameter of type 'long double *' [-Wincompatible-pointer-types]
          return modfl(x, iptr);
                          ^~~~
      /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/math.h:394:52: note: passing argument to parameter here
      extern long double modfl(long double, long double *);
                                                         ^
      numpy/core/src/multiarray/_multiarray_tests.c.src:1923:61: warning: format specifies type 'long double' but the argument has type 'npy_longdouble' (aka 'double') [-Wformat]
              PyOS_snprintf(str, sizeof(str), "%.*Lg", precision, x);
                                               ~~~~~              ^
                                               %.*g
      2 warnings generated.
      clang -bundle -undefined dynamic_lookup -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8/numpy/core/src/multiarray/_multiarray_tests.o build/temp.macosx-12-arm64-cpython-38/numpy/core/src/common/mem_overlap.o -Lbuild/temp.macosx-12-arm64-cpython-38 -lnpymath -o build/lib.macosx-12-arm64-cpython-38/numpy/core/_multiarray_tests.cpython-38-darwin.so
      ld: warning: -undefined dynamic_lookup may not work with chained fixups
      building 'numpy.core._multiarray_umath' extension
      compiling C sources
      C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
      
      creating build/temp.macosx-12-arm64-cpython-38/numpy/core/src/multiarray
      creating build/temp.macosx-12-arm64-cpython-38/numpy/core/src/umath
      creating build/temp.macosx-12-arm64-cpython-38/build/src.macosx-12-arm64-3.8/numpy/core/src/umath
      creating build/temp.macosx-12-arm64-cpython-38/private
      creating build/temp.macosx-12-arm64-cpython-38/private/var
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders/9x
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-install-sh2vo79x
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-install-sh2vo79x/numpy_2f275be08abf460d9f7ebbc831c5ddb7
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-install-sh2vo79x/numpy_2f275be08abf460d9f7ebbc831c5ddb7/numpy
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-install-sh2vo79x/numpy_2f275be08abf460d9f7ebbc831c5ddb7/numpy/_build_utils
      creating build/temp.macosx-12-arm64-cpython-38/private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-install-sh2vo79x/numpy_2f275be08abf460d9f7ebbc831c5ddb7/numpy/_build_utils/src
      compile options: '-DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/umath -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-12-arm64-3.8/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/opt/homebrew/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/include/python3.8 -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -c'
      extra options: '-faltivec -I/System/Library/Frameworks/vecLib.framework/Headers'
      clang: numpy/core/src/multiarray/alloc.c
      clang: numpy/core/src/multiarray/array_assign_scalar.c
      clang: numpy/core/src/multiarray/common.c
      clang: numpy/core/src/multiarray/conversion_utils.c
      clang: numpy/core/src/multiarray/buffer.c
      clangclang: : error: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitlythe clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      
      clang: numpy/core/src/multiarray/descriptor.c
      clang: numpy/core/src/multiarray/hashdescr.c
      clang: numpy/core/src/multiarray/datetime_strings.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/multiarray/einsum.c
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/multiarray/lowlevel_strided_loops.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: numpy/core/src/multiarray/multiarraymodule.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: numpy/core/src/multiarray/nditer_constr.c
      clang: numpy/core/src/multiarray/refcount.c
      clang: numpy/core/src/multiarray/scalarapi.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: numpy/core/src/multiarray/temp_elide.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: numpy/core/src/multiarray/vdot.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/umath/loops.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: numpy/core/src/umath/ufunc_object.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: build/src.macosx-12-arm64-3.8/numpy/core/src/umath/scalarmath.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: numpy/core/src/npymath/npy_math.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: numpy/core/src/npymath/halffloat.c
      clang: numpy/core/src/common/numpyos.c
      clang: numpy/core/src/common/npy_longdouble.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: /private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-install-sh2vo79x/numpy_2f275be08abf460d9f7ebbc831c5ddb7/numpy/_build_utils/src/apple_sgemv_fix.c
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      clang: error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
      Running from numpy source directory.
      /private/var/folders/9x/grsv4dws25j7wc9f16mt6fzx7nz37c/T/pip-build-env-vcfnfhxr/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'define_macros'
        warnings.warn(msg)
      error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -DNPY_INTERNAL_BUILD=1 -DHAVE_NPY_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -DNO_ATLAS_INFO=3 -DHAVE_CBLAS -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/umath -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-12-arm64-3.8/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/opt/homebrew/opt/python@3.8/Frameworks/Python.framework/Versions/3.8/include/python3.8 -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/common -Ibuild/src.macosx-12-arm64-3.8/numpy/core/src/npymath -c numpy/core/src/multiarray/alloc.c -o build/temp.macosx-12-arm64-cpython-38/numpy/core/src/multiarray/alloc.o -MMD -MF build/temp.macosx-12-arm64-cpython-38/numpy/core/src/multiarray/alloc.o.d -faltivec -I/System/Library/Frameworks/vecLib.framework/Headers" failed with exit status 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects.

我不知道為什么會發生這個錯誤。 請注意,我應該為項目安裝 1.18.1 numpy。

你可以幫幫我嗎?

謝謝。

試試這個命令(為我工作):

python -m pip install --force-reinstall numpy==1.18.1

消除此錯誤的第一個解決方案是先升級 pip 命令。 升級后嘗試使用 pip 命令安裝 NumPy 版本。 但一定要檢查 python 的版本。

嘗試更新 pip: pip install --upgrade pip

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM