升级tensorflow后,出现报错信息:ImportError: No module named protobuf
。
>>> from tensorflow.examples.tutorials.mnist import input_data
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/Chris/HappyCoding/tensorflow/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import *
File "/Users/Chris/HappyCoding/tensorflow/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 52, in <module>
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 <module>
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