Mik*_*maa 13 python numpy python-poetry
我有一个 Numpy 作为 Poetrypyproject.toml文件中的依赖项,但安装失败。
error: the clang compiler does not support 'faltivec', please use -maltivec and include altivec.h explicitly
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.9/numpy/core/src/umath -Ibuild/src.macosx-12-arm64-3.9/numpy/core/src/npymath -Ibuild/src.macosx-12-arm64-3.9/numpy/core/src/common -Inumpy/core/include -Ibuild/src.macosx-12-arm64-3.9/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/Users/moo/Library/Caches/pypoetry/virtualenvs/dex-ohlcv-qY1n4duk-py3.9/include -I/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/include/python3.9 -Ibuild/src.macosx-12-arm64-3.9/numpy/core/src/common -Ibuild/src.macosx-12-arm64-3.9/numpy/core/src/npymath -c numpy/core/src/multiarray/array_assign_scalar.c -o build/temp.macosx-12-arm64-3.9/numpy/core/src/multiarray/array_assign_scalar.o -MMD -MF build/temp.macosx-12-arm64-3.9/numpy/core/src/multiarray/array_assign_scalar.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
Run Code Online (Sandbox Code Playgroud)
怎么解决呢?
如果我用 pip 安装 Numpy 它安装得很好。
Mik*_*maa 17
确保您已从 Homebrew 安装了 OpenBLAS:
\nbrew install openblas\nRun Code Online (Sandbox Code Playgroud)\n然后,在运行任何安装脚本之前,请确保告诉您的 shell 环境使用 Homebrew OpenBLAS 安装
\nbrew install openblas\nRun Code Online (Sandbox Code Playgroud)\n如果出现错误
\n File "/private/var/folders/tx/50wn88yd40v2_6_7fvfr98z00000gn/T/pip-build-env-uq7qd2ba/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 252, in get_tag\n plat_name = get_platform(self.bdist_dir)\n File "/private/var/folders/tx/50wn88yd40v2_6_7fvfr98z00000gn/T/pip-build-env-uq7qd2ba/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 48, in get_platform\n result = calculate_macosx_platform_tag(archive_root, result)\n File "/private/var/folders/tx/50wn88yd40v2_6_7fvfr98z00000gn/T/pip-build-env-uq7qd2ba/overlay/lib/python3.9/site-packages/wheel/macosx_libfile.py", line 356, in calculate_macosx_platform_tag\n assert len(base_version) == 2\n AssertionError\nRun Code Online (Sandbox Code Playgroud)\n这个问题应该已经在最近足够多的 Python 打包工具中得到修复。
\n确保
\n例如在你的pyproject.toml
[tool.poetry.dependencies]\n# For Scipy compatibility\npython = ">=3.9,<3.11"\n\nscipy = "^1.8.0"\npyarrow = "^7.0.0"\nRun Code Online (Sandbox Code Playgroud)\n即使这仍然失败,您也可以尝试在 Poetry virtualenv 中运行之前scipy预安装(输入) 这应该会拾取预编译的 scipy 轮子。当预编译轮存在时,Poetry 不应尝试再次安装它,然后导致构建步骤失败。pippoetry installpoetry shell
export OPENBLAS="$(brew --prefix openblas)" \npoetry install\nRun Code Online (Sandbox Code Playgroud)\nCollecting scipy\n Downloading scipy-1.8.0-cp39-cp39-macosx_12_0_arm64.whl (28.7 MB)\n \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 28.7/28.7 MB 6.0 MB/s eta 0:00:00\nRequirement already satisfied: numpy<1.25.0,>=1.17.3 in /Users/moo/Library/Caches/pypoetry/virtualenvs/dex-ohlcv-qY1n4duk-py3.9/lib/python3.9/site-packages (from scipy) (1.22.3)\nInstalling collected packages: scipy\nSuccessfully installed scipy-1.8.0\nRun Code Online (Sandbox Code Playgroud)\n之后正常运行 Poetry:
\npoetry install\nRun Code Online (Sandbox Code Playgroud)\n
| 归档时间: |
|
| 查看次数: |
8424 次 |
| 最近记录: |