Tensorflow:使用虚拟环境验证安装

时间:2018-07-23 16:05:15

标签: python-3.x tensorflow virtualenv

操作系统:Mac

我能够安装python(3.7),更新pip3(18.0)

然后我还能够使用

安装tensorflow
pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.9.0-py3-none-any.whl

但是当我尝试测试安装并运行

import tensorflow as tf
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/digvijay.upadhyay/p3/lib/python3.7/site-packages/tensorflow/__init__.py", line 22, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/Users/digvijay.upadhyay/p3/lib/python3.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Users/digvijay.upadhyay/p3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 58, in <module>
    from tensorflow.python.pywrap_tensorflow_internal import *
  File "/Users/digvijay.upadhyay/p3/lib/python3.7/site-packages/tensorflow/python/pywrap_tensorflow_internal.py", line 114
    def TFE_ContextOptionsSetAsync(arg1, async):
                                             ^
SyntaxError: invalid syntax

我还尝试过重新安装python,但没有成功

0 个答案:

没有答案