Python3 ImportError:没有名为“ google.protobuf”的模块

时间:2018-07-17 15:45:49

标签: python protocol-buffers caffe pycaffe matcaffe

我已经在ubuntu系统中编译了protobuf 2.6.0源代码,一旦我想导入caffe,它就会显示以下错误:

/usr/local/lib/python3.5/dist-packages/caffe/__init__.py:30: UserWarning: Caffe datatype DOUBLE not available.
  warnings.warn("Caffe datatype DOUBLE not available.")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/caffe/__init__.py", line 41, in <module>
    from .proto.caffe_pb2 import TRAIN, TEST
  File "/usr/local/lib/python3.5/dist-packages/caffe/proto/caffe_pb2.py", line 6, in <module>
    from google.protobuf.internal import enum_type_wrapper
ImportError: No module named 'google.protobuf'
>>> 
[11]+  Stopped                 python3

我已经在.bashrc中导出了protobuf路径 导出LD_LIBRARY_PATH=/usr/local/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

caffe由Python3构建。如何解决此问题?

2 个答案:

答案 0 :(得分:0)

编译后是否运行过make install

答案 1 :(得分:0)

我建议您删除并重新安装。如果使用conda,请确保将其从pip和conda中删除。 这是在社区中打开的issue