PyN*_*erd 14 python protocol-buffers caffe
我在我的机器上安装了Anaconda Python.当我启动Python解释器并在Python shell中键入"import caffe"时,我收到以下错误:
ImportError: No module named google.protobuf.internal
Run Code Online (Sandbox Code Playgroud)
我有以下文件:
wire_format_lite_inl.h
wire_format_lite.h
wire_format.h
unknown_field_set.h
text_format.h
service.h
repeated_field.h
reflection_ops.h
message_lite.h
message.h
generated_message_util.h
extension_set.h
descriptor.proto
descriptor.h
generated_message_reflection.h
generated_enum_reflection.h
dynamic_message.h
descriptor.pb.h
descriptor_database.h
Run Code Online (Sandbox Code Playgroud)
我需要哪些文件才能导入?是否需要"internal.h"文件?
Jay*_*wal 32
这可能是因为你的机器中有两个python环境,一个是你的linux发行版(pip)提供的,另一个是anaconda环境(/home/username/anaconda2/bin/pip).
pip install protobuf
/home/username/anaconda2/bin/pip install protobuf
如果您使用的是Ubuntu,请尝试使用安装protobuf
sudo apt-get install protobuf
Run Code Online (Sandbox Code Playgroud)
它解决了我遇到的同样问题.