Poetry在m1 Mac上安装Numpy导致python 3.7的EnvCommandError失败



我一直试图在M1 Mac上安装python 3.7的诗歌环境中安装Numpy,但在尝试了许多不同的解决方案后收到了相同的EnvCommandError。我仍然没能制造车轮,并看到了一个关于不支持游行旗帜的错误。我还将包括由此产生的错误消息的底部。

我尝试过的东西

  • 罗塞塔启动终端并安装pip和x86 arch标志
  • 罗塞塔启动终端并安装诗歌
  • Brew安装OPENBlas并在设置OPENBlas路径后运行
  • 克隆Numpy并在没有二进制和pep 517标志的情况下安装
  • 运行最新版本的诗歌

错误消息

Warning: attempted relative import with no known parent package
/private/var/folders/g8/n76149jx1_s8bmqh02_lsmnh0000gp/T/pip-build-env-9yu5k12r/overlay/lib/python3.7/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
warnings.warn(msg)
error: Command "clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/opt/homebrew/opt/openssl@3/include -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.2-arm64-3.7/numpy/core/src/common -Ibuild/src.macosx-12.2-arm64-3.7/numpy/core/src/umath -Inumpy/core/include -Ibuild/src.macosx-12.2-arm64-3.7/numpy/core/include/numpy -Ibuild/src.macosx-12.2-arm64-3.7/numpy/distutils/include -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 -Inumpy/core/src/_simd -I/Users/maxnguyen/Library/Caches/pypoetry/virtualenvs/dataflow-ieQly66s-py3.7/include -I/Users/maxnguyen/.pyenv/versions/3.7.12/include/python3.7m -Ibuild/src.macosx-12.2-arm64-3.7/numpy/core/src/common -Ibuild/src.macosx-12.2-arm64-3.7/numpy/core/src/npymath -c build/src.macosx-12.2-arm64-3.7/numpy/core/src/umath/loops_unary_fp.dispatch.c -o build/temp.macosx-12.2-arm64-3.7/build/src.macosx-12.2-arm64-3.7/numpy/core/src/umath/loops_unary_fp.dispatch.o -MMD -MF build/temp.macosx-12.2-arm64-3.7/build/src.macosx-12.2-arm64-3.7/numpy/core/src/umath/loops_unary_fp.dispatch.o.d -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

at ~/.poetry/lib/poetry/utils/env.py:1195 in _run
1191│                 output = subprocess.check_output(
1192│                     cmd, stderr=subprocess.STDOUT, **kwargs
1193│                 )
1194│         except CalledProcessError as e:
→ 1195│             raise EnvCommandError(e, input=input_)
1196│ 
1197│         return decode(output)
1198│ 
1199│     def execute(self, bin, *args, **kwargs):

假设您已经安装了openblas(brew install openblas(,请尝试以下操作:

OPENBLAS="$(brew --prefix openblas)" poetry install

最新更新