ImportError: No module named protobuf

升级tensorflow后,出现报错信息:ImportError: No module named protobuf

>>> from tensorflow.examples.tutorials.mnist import input_data
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/Chris/HappyCoding/tensorflow/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in 
    from tensorflow.python import *
  File "/Users/Chris/HappyCoding/tensorflow/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 52, in 
    from tensorflow.core.framework.graph_pb2 import *
  File "/Users/Chris/HappyCoding/tensorflow/lib/python2.7/site-packages/tensorflow/core/framework/graph_pb2.py", line 6, in 
    from google.protobuf import descriptor as _descriptor
ImportError: No module named protobuf

临时解决办法:卸载 tensorflow,重新安装

pip uninstall tensorflow
pip uninstall protobuf
pip uninstall google
pip install ~/Downloads/tensorflow-1.4.0-py2-none-any.whl 

你可能感兴趣的:(ImportError: No module named protobuf)