protobuf報錯

 

>>> import tensorflow as tf
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 *
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.protobuf'

試了不少方法 差點卸載tensorflow重裝了python

最後卸載protobufbash

pip uninstall protobuf

能夠執行屢次 直到把全部版本protobuf所有卸載ide

而後再次安裝protobuf google

pip install protobuf

而後遇到了新問題:spa

Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/protobuf-3.6.0-py3.5-nspkg.pth'
Consider using the `--user` option or check the permissions.code

執行:blog

pip install  -- user protobuf
相關文章
相關標籤/搜索