微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无法在 Apple M1 上安装 python lib 'coremltools' - Python 3.9 版

如何解决无法在 Apple M1 上安装 python lib 'coremltools' - Python 3.9 版

我正在尝试在 macbook air m1 上安装 coremltools。

直到这一切都很好。

Defaulting to user installation because normal site-packages is not writeable
Collecting coremltools
  Using cached coremltools-4.1-py3-none-any.whl
Collecting packaging
  Using cached packaging-20.9-py2.py3-none-any.whl (40 kB)
Requirement already satisfied: six>=1.10.0 in /Applications/Xcode.app/Contents/Developer/Library/Frameworks/python3.framework/Versions/3.8/lib/python3.8/site-packages (from coremltools) (1.15.0)
Collecting attrs
  Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting attr
  Using cached attr-0.3.1-py3-none-any.whl
Collecting tqdm
  Using cached tqdm-4.61.1-py2.py3-none-any.whl (75 kB)
Collecting numpy<1.20,>=1.14.5
  Using cached numpy-1.19.5.zip (7.3 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel Metadata ... done
Collecting scipy
  Using cached scipy-1.6.3.tar.gz (27.2 MB)
  Installing build dependencies ... -

Then comes this huge error that takes time to copy paste,It was a 1M line of error,can't paste it in here.

我认为问题出在

使用缓存的 scipy-1.6.3.tar.gz (27.2 MB) 安装构建依赖... \

为这个 scipy 安装依赖项 以下是出现巨大错误后的警告。

WARNING: discarding https://files.pythonhosted.org/packages/99/f1/c00d6be56e1a718a3068079e3ec8ce044d7179345280f6a3f5066068af0d/scipy-1.6.2.tar.gz#sha256=e9da33e21c9bc1b92c20b5328adb13e5f193b924c9b969cd700c8908f315aa59 (from https://pypi.org/simple/scipy/) (requires-python:>=3.7,<3.10). Command errored out with exit status 1: /Applications/Xcode.app/Contents/Developer/usr/bin/python3 /private/var/folders/qf/689v8qpx1n7bqjzjpykz94jw0000gn/T/pip-standalone-pip-woxmm656/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/qf/689v8qpx1n7bqjzjpykz94jw0000gn/T/pip-build-env-voc6ce_x/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'wheel<0.37.0' 'setuptools<=51.0.0' 'Cython>=0.29.18,<3.0' 'pybind11>=2.4.3,<2.7.0' 'numpy==1.19.2; python_version=='"'"'3.6'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.19.2; python_version=='"'"'3.7'"'"' and platform_machine=='"'"'aarch64'"'"'' 'numpy==1.16.5; python_version=='"'"'3.6'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_python_implementation != '"'"'PyPy'"'"'' 'numpy==1.16.5; python_version=='"'"'3.7'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_python_implementation != '"'"'PyPy'"'"'' 'numpy==1.17.3; python_version=='"'"'3.8'"'"' and platform_machine!='"'"'aarch64'"'"' and platform_python_implementation != '"'"'PyPy'"'"'' 'numpy==1.19.3; python_version=='"'"'3.9'"'"' and platform_python_implementation != '"'"'PyPy'"'"'' 'numpy==1.19.0; python_version=='"'"'3.6'"'"' and platform_python_implementation=='"'"'PyPy'"'"'' 'numpy==1.20.0; python_version=='"'"'3.7'"'"' and platform_python_implementation=='"'"'PyPy'"'"'' 'numpy; python_version>='"'"'3.10'"'"'' 'numpy; python_version>='"'"'3.8'"'"' and platform_python_implementation=='"'"'PyPy'"'"'' Check the logs for full command output.

解决方法

我正在为 python 3.9.x 安装它,请注意,截至今天(2021 年 6 月 19 日),它可用于 3.6.x - 3.8.x。将您的 Python 版本更改为 3.6.x - 3.8.x。那应该可行。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。