Ubuntu +新用户+ ImportError:没有名为“ google”的模块

时间:2019-02-20 13:46:12

标签: python tensorflow ubuntu-16.04

我在Ubuntu16.04中创建一个新用户。但是我无法在新用户中导入tensorflow。它向我暗示,ImportError: No module named 'google'

我使用tensorflow-gpu==1.7.0 + cuda-9.0 + cudnn-7.0和python 3.5

Python 3.5.2 (default, Nov 12 2018, 13:43:14) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
`>>>`import tensorflow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *  # pylint: disable=redefined-builtin
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/usr/local/lib/python3.5/dist-packages/tensorflow/core/framework/graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ImportError: No module named 'google'

1 个答案:

答案 0 :(得分:0)

您尝试了以下命令:

pip3 install google --user