Protobuf Runtime Installation
Hello, I follow the page to install protocol buffers: https://github.com/google/protobuf I download the source code with python-protobuf3,1,0 with my Mac , I use anaconda python2,7 what I run is: 1)./configure 2)make 3)make install 4)make check 5) cd python 6) python setup.py build python setup.py test 7) python setup.py build --cpp_implementation
All the above seems to be ok, but when I run c++ implementation, it give me errors: 8)python setup.py test --cpp_implementation
~/Hao/tutorial/gRPC/protocol_buffers/protobuf-3.1.0/python python setup.py test --cpp_implementation running test running 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 reading manifest file 'protobuf.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' 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 '*.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' running build_ext copying build/lib.macosx-10.6-x86_64-2.7/google/protobuf/pyext/_message.so -> google/protobuf/pyext copying build/lib.macosx-10.6-x86_64-2.7/google/protobuf/internal/_api_implementation.so -> google/protobuf/internal Traceback (most recent call last): File "setup.py", line 252, in <module> ext_modules=ext_module_list, File "/Users/junhao.wen/anaconda2/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/Users/junhao.wen/anaconda2/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/Users/junhao.wen/anaconda2/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/Users/junhao.wen/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/setuptools/command/test.py", line 170, in run File "/Users/junhao.wen/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/setuptools/command/test.py", line 191, in run_tests File "/Users/junhao.wen/anaconda2/lib/python2.7/unittest/main.py", line 94, in __init__ self.parseArgs(argv) File "/Users/junhao.wen/anaconda2/lib/python2.7/unittest/main.py", line 149, in parseArgs self.createTests() File "/Users/junhao.wen/anaconda2/lib/python2.7/unittest/main.py", line 158, in createTests self.module) File "/Users/junhao.wen/anaconda2/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames suites = [self.loadTestsFromName(name, module) for name in names] File "/Users/junhao.wen/anaconda2/lib/python2.7/unittest/loader.py", line 103, in loadTestsFromName return self.loadTestsFromModule(obj) File "/Users/junhao.wen/anaconda2/lib/python2.7/site-packages/setuptools-23.0.0-py2.7.egg/setuptools/command/test.py", line 39, in loadTestsFromModule File "/Users/junhao.wen/anaconda2/lib/python2.7/unittest/loader.py", line 100, in loadTestsFromName parent, obj = obj, getattr(obj, part) AttributeError: 'module' object has no attribute 'any_test_pb2'
Any advise is appreciated, I am quite new to goolge protobuf Thanks in advance
I think you only install the library for cpp but not the one for python. To install python in addition to installing cpp:
- cd python
- python setup.py install --cpp_implementation
Hi thanks for your reply, but actually I did python setup.py install and still I got the same error, still have some other ideas? Thank you in advance
Any advice??????
I got the same error on 3.0.2, 3.1.0, and 3.2.0rc2 with gcc. On 3.2.0rc2, after using clang, I got the same error when I did not run make install before the Python build. After make install and another clean Python build though the error you mention is no longer there for me.
Looks like clang can solve this problem.
Closing it for clean up. Feel free to reopen if it is still an issue