无法使用Python 2.7在Mac上安装Tensorflow

时间:2018-05-12 15:59:13

标签: python tensorflow

我尝试按照https://www.tensorflow.org/install/install_mac#common_installation_problems的说明安装tensorflow。现在我在第7步:

  

可选。如果步骤6失败(通常是因为您调用了低于8.1的点数版本),请通过发出以下格式的命令在活动的Virtualenv环境中安装TensorFlow:

$ pip install --upgrade tfBinaryURL   # Python 2.7

 $ pip3 install --upgrade tfBinaryURL  # Python 3.n 

其中tfBinaryURL标识TensorFlow Python包的URL。 tfBinaryURL的适当值取决于操作系统和Python版本。在此处为系统找到tfBinaryURL的适当值。

例如,如果要安装TensorFlow for macOS,Python 2.7,在活动Virtualenv中安装TensorFlow的命令如下:

$ pip3 install --upgrade \
 https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.8.0-py3-none-any.whl

当我使用Mac和Python 2.7时,我使用了这个命令:

$ pip3 install --upgrade \
 https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.8.0-py3-none-any.whl

但后来我收到了一条错误消息:

  

Command&#34; /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c&#34; import setuptools,tokenize; file =&# 39; /private/tmp/pip-install-cx8mykog/grpcio/setup.py' ;; f = getattr(tokenize,&#39; open&#39;,open)(文件); code = f.read()。replace(&#39; \ r \ n&#39;,&#39; \ n&#39;); f.close(); exec(编译(代码,文件< / strong>,&#39; exec&#39;))&#34; install --record /private/tmp/pip-record-42j10q8x/install-record.txt --single-version-external-managed --compile&#34;在/ private / tmp / pip-install-cx8mykog / grpcio /

中出现错误代码1失败

有人可以帮我吗?

0 个答案:

没有答案