码迷,mamicode.com
首页 > 其他好文 > 详细

protobuf报错

时间:2018-08-10 21:25:05      阅读:565      评论:0      收藏:0      [点我收藏+]

标签:usr   bash   ace   most   ror   module   core   mos   init   

 

>>> 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重装了

最后卸载protobuf

pip uninstall protobuf

可以执行多次 直到把所有版本protobuf全部卸载

然后再次安装protobuf 

pip install protobuf

然后遇到了新问题:

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.

执行:

pip install  -- user protobuf

 

protobuf报错

标签:usr   bash   ace   most   ror   module   core   mos   init   

原文地址:https://www.cnblogs.com/hozhangel/p/9457027.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!