无法在 Mac 上升级 tensorflow [英] Not able to upgrade tensorflow on mac
问题描述
我正在运行命令来升级 tensorflow,但总是低于错误.
I am running command to upgrade tensorflow, But always getting below error.
Could not find a version that satisfies the requirement tensorflow-gpu (from versions: )
我尝试过以下命令:
pip3 install --upgrade tensorflow
pip3 install --upgrade tensorflow-gpu
推荐答案
我有一个无法找到满足XYZ要求的版本
错误的清单:
您使用的 pip
指的是哪个 python 版本 - 它是正确的吗?假设您已经安装了 python3.4
和 python3.5
并使用了符号链接到 pip3.4
的 pip3
命令虽然您假设它是符号链接到 pip3.5
.所以先发布:
What python version does the pip
you're using refer to - is it the correct one? Imagine you have python3.4
and python3.5
installed and using pip3
command that is symlinked to pip3.4
while you assume it is symlinked to pip3.5
. So issue first:
$ pip3 -V | grep -o "(.*)"
并验证是否打印了正确的 python 版本.如果不是,那么您必须找到正确的 pip
可执行文件:首先检查您是否有可用的版本特定命令(例如
and verify the correct python version is printed. If it's not, then you have to find the correct pip
executable: first check if you have version-specific commands available (e.g.
$ which pip3.6
for python3.6
) 并使用上面的命令验证它是否指向正确的 python 版本(例如 $ pip3.6 -V | grep -o "(.*)"
).如果没有特定于版本的 pip
,请开始在 sys.prefix
的 bin
子目录中搜索正确的可执行文件.我机器上的例子:
for python3.6
) and verify it is pointing to the correct python version with the command above (e.g. $ pip3.6 -V | grep -o "(.*)"
). If there is no version-specific pip
, start searching for the correct executable in the sys.prefix
's bin
subdirectory. Example on my machine:
$ python3.6 -c "import sys; print(sys.prefix)" | xargs -I {} find {}/bin -name pip*
/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3.6
/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3
平台检查
您的目标机器上的平台可能不匹配.检查pip
识别的平台:
$ python3.6 -c "import pip; print(pip.pep425tags.get_platform())"
对于 10.0 以上的 pip
:
For pip
newer than 10.0:
$ python3.6 -c "import pip._internal as pip; print(pip.pep425tags.get_platform())"
输出应为 macosx_10_11_x86_64
或更新版本(例如 macosx_10_13_x86_64
).如果您使用的是较旧的 OSX,则必须从源代码构建 TensorFlow,因为 预构建包仅适用于 MacOS 10.11 及更高版本.
The output should be macosx_10_11_x86_64
or newer (e.g. macosx_10_13_x86_64
). If you have an older OSX, you will have to build TensorFlow from source because prebuilt packages exist for MacOS 10.11 and higher only.
支持的其他平台有:manylinux1_x86_64
(所以所有带有 glibc>2.5
的 64 位 Linux 发行版应该都可以,没有 32 位发行版或一些像 Alpine 这样带有 musl
) 和 win_amd64
(64 位 Windows).
Other platforms supported are: manylinux1_x86_64
(so all the 64bit Linux distros with glibc>2.5
should do just fine, no 32bit distros or some exotic ones like Alpine with musl
) and win_amd64
(64bit Windows).
一个不太常见的问题是 ABI 不匹配:您可以使用
A less common problem is the ABI mismatch: you can check your platform's ABI with
$ python3.6 -c "import pip; print(pip.pep425tags.get_abi_tag())"
对于 10.0 以上的 pip
:
For pip
newer than 10.0:
$ python3.6 -c "import pip._internal as pip; print(pip.pep425tags.get_abi_tag())"
目前支持的ABI标签有:cp27m
、cp27mu
、cp33m
、cp34m
、cp35m
, cp36m
.上面的命令应该为您打印列出的标签之一.如果没有,您将不得不从源代码构建/安装.
The supported ABI tags are currently: cp27m
, cp27mu
, cp33m
, cp34m
, cp35m
, cp36m
. The above command should print you one of the tags listed. If not, you will have to build/install from sources.
一种罕见的情况可能是 PyPI 索引配置错误:运行
A rare case could be a misconfigured PyPI index: run
$ pip3 install --upgrade tensorflow --verbose
Collecting tensorflow
2 location(s) to search for versions of tensorflow:
* https://pypi.python.org/simple/tensorflow/
* https://my.pypi.server/base/dev/+simple/tensorflow/
...
检查 https://pypi.python.org/simple/tensorflow/
是否在列表中.如果没有,请尝试命令
Check if https://pypi.python.org/simple/tensorflow/
is in the list. If not, try the command
$ pip3 install --upgrade tensorflow --index-url=https://pypi.python.org/simple
如果安装成功,请检查您是否设置了PIP_INDEX_URL
环境变量并清除它.如果没有,请检查文件 ~/.pip/pip.conf
是否存在,以及它是否定义了 index-url
条目.
If the installation succeeds, check if you have PIP_INDEX_URL
environment variable set and clear it. If not, check if you have the file ~/.pip/pip.conf
present and if it has index-url
entry defined.
这篇关于无法在 Mac 上升级 tensorflow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!