【发布时间】:2021-09-29 10:41:06
【问题描述】:
试图在 Mac Mini M1 中安装 tensorflow 是一场漫长的斗争...... 我正在使用 macOS Monterey(12.0 Beta) 根据 tensorflow/apple (https://developer.apple.com/metal/tensorflow-plugin/) 的最后指示,我使用 miniforge conda,创建一个空白环境,然后执行以下操作:
conda install -c apple tensorflow-deps
一切正常,但是当我执行下一步时,一切都中断了:
python -m pip install tensorflow-macos
-
尝试使用 python3.8 出现以下错误(摘要,而不是完整日志):
distutils.errors.CompileError: command 'gcc' failed with exit status 1 ---------------------------------------- ERROR: Failed building wheel for grpcio -
尝试使用 python3.9 出现以下错误(摘要,而不是完整日志):
distutils.errors.CompileError: command '/usr/bin/clang' failed with exit code 1 ---------------------------------------- ERROR: Failed building wheel for grpcio -
尝试强制重新安装和 no-cache-dir
(python -m pip install tensorflow-macos --no-cache-dir --force-reinstall),但出现以下错误:错误:命令出错,退出状态为 1:/Users/machine/miniforge3/envs/tf38/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/0k/hz9yngm56nz1htdc3c3t3d0c0000gn/T/pip-install-djre1j5j/numpy_48546adcbc9d4c558a4dc32a8e607649/setup.py'"'"'; 文件='"'"'/private/var/folders/0k/hz9yngm56nz1htdc3c3t3d0c0000gn/T/pip-install-djre1j5j/numpy_48546adcbc9d4c558a4dc32a8e607649/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"' from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"' "');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/ 0k/hz9yngm56nz1htdc3c3t3d0c0000gn/T/pip-record-343ln54c/install-record.txt --single-version-externally-managed --prefix /private/var/folders/0k/hz9yngm56nz1htdc3c3t3d0c0000gn/T/pip-build-env-1fyu7c9t/ normal --compile --install-headers /private/var/folders/0k/hz9yngm56nz1htdc3c3t3d0c0000gn/T/pip-build-env-1fyu7c9t/normal/include/python3.8/numpy 检查日志以获取完整的命令输出。 -------------------------------------- 警告:丢弃https://files.pythonhosted.org/packages/a7/81/20d5d994c91ed8347efda90d32c396ea28254fd8eb9e071e28ee5700ffd5/h5py-3.1.0.tar.gz#sha256=1e2516f190652beedcb8c7acfa1c6fa92d99b42331cbef5e5c7ec2d65b0fc3c2(来自https://pypi.org/simple/h5py/)(需要python:> = 3.6)。命令出错,退出状态为 1:/Users/machine/miniforge3/envs/tf38/bin/python /private/var/folders/0k/hz9yngm56nz1htdc3c3t3d0c0000gn/T/pip-standalone-pip-nmsgrvml/env_pip.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/0k/hz9yngm56nz1htdc3c3t3d0c0000gn/T/pip-build-env-1fyu7c9t/normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'numpy==1.12; python_version == "3.6"' 'Cython>=0.29; python_version = "3.9"' 'numpy==1.17.5; python_version == "3.8"' pkgconfig 'Cython>=0.29.14; python_version >= "3.8"' 检查日志以获取完整的命令输出。 错误:找不到满足要求的版本 h5py~=3.1.0(来自 tensorflow-macos)(来自版本:2.2.1、2.3.0b1、2.3.0、2.3.1、2.4.0b1、2.4.0 , 2.5.0, 2.6.0, 2.7.0rc2, 2.7.0, 2.7.1, 2.8.0rc1, 2.8.0, 2.9.0rc1, 2.9.0, 2.10.0, 3.0.0rc1, 3.0.0, 3.1 .0、3.2.0、3.2.1、3.3.0、3.4.0) 错误:未找到 h5py~=3.1.0 的匹配分布
【问题讨论】:
标签: macos tensorflow apple-m1