我在我的机器上安装了Python。当我启动Python解释器并在Python shell中键入“import caffe”时,会出现以下错误:
ImportError: No module named google.protobuf.internal
我有以下文件:
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
我需要什么文件才能进行导入?是否需要“internal.h”文件?
如果您使用的是Ubuntu,请尝试使用
它解决了我面临的同样的问题。
这可能是因为您的机器中有两个python环境,一个由linux发行版提供(
pip
),另一个由anaconda环境提供(/home/username/anaconda2/bin/pip
)。尝试为两个环境安装protobuf以确保
pip install protobuf
/home/username/anaconda2/bin/pip install protobuf
如果你用的是水蟒,就要
conda install protobuf
相关问题 更多 >
编程相关推荐