找不到满足tensorflow - python3.9 64位要求的版本。

3

我想使用Tensorflow进行联合学习,但是使用pip无法成功安装。

pip install tensorflow

我收到的错误信息是:

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow

我正在使用Python3.9.10运行虚拟环境,并且在M1 Mac上工作。
我查看了类似的帖子(我想安装tensorflow,但出现以下消息:找不到满足要求tensorflow(来自版本:none)),其中建议检查Python版本并尝试使用tf-nightly。我已经尝试过这些方法,但没有成功。
1个回答

10

tensorflow pypi页面上,没有适用于arm64的tensorflow文件可用。 不过,有一份指南可以教你如何在Mac上安装tensorflow。不过,你需要使用conda

conda create -n TFmacOS python=3.9 pip
conda activate TFmacOS 
conda install -c apple tensorflow-deps==2.7.0
python -m pip install tensorflow-macos==2.7.0
python -m pip install tensorflow-metal
编辑: 上述信息已过时,仅适用于tensorflow < 2.12版本。从tensorflow 2.12版本开始,在相关的pypi页面上有arm64 whl文件可用,可以直接安装tensorflow。不过,建议在苹果芯片上安装金属插件以加速运行(详见上述链接的指南)。
python -m pip install tensorflow-metal

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接