以下步骤安装:
`git clone https://github.com/google/protobuf
cd python/
sudo python setup.py install`
但是我收到以下错误:
`running install
running bdist_egg
running egg_info
creating protobuf.egg-info
writing requirements to protobuf.egg-info/requires.txt
writing protobuf.egg-info/PKG-INFO
writing namespace_packages to protobuf.egg-info/namespace_packages.txt
writing top-level names to protobuf.egg-info/top_level.txt
writing dependency_links to protobuf.egg-info/dependency_links.txt
writing manifest file 'protobuf.egg-info/SOURCES.txt'
reading manifest file 'protobuf.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files found matching 'google/protobuf/internal/*_pb2.py'
warning: no previously-included files found matching 'google/protobuf/internal/*.proto'
warning: no previously-included files matching '*_test.py' found under directory 'google'
warning: no previously-included files matching '*_test.proto' found under directory 'google'
warning: no previously-included files matching 'unittest*_pb2.py' found under directory 'google'
warning: no previously-included files matching '*.dll' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
writing manifest file 'protobuf.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
Generating google/protobuf/descriptor_pb2.py...
protoc is not installed nor found in ../src. Please compile it or install the binary package.`
不确定需要做什么。请帮忙!提前谢谢!
答案 0 :(得分:0)
您需要首先构建协议缓冲区编译器(protoc
)。在Git仓库的顶部,只需运行./autogen.sh && ./configure && make
。