I am on Ubuntu 14.10 and I'm using protobuf 2.6.1, built from source.

When I try to run the python protobuf tests, I get the below error.

18:44:33 ~/Setup/protobuf-2.6.1/python
$ python setup.py google_test
running google_test
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'
writing manifest file 'protobuf.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 200, in <module>
    "Protocol Buffers are Google's data interchange format.",
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", 
line 142, in run
  File "/usr/local/lib/python2.7/dist-packages/setuptools/command/test.py", 
line 122, in with_project_on_sys_path
line 157, in run_tests
    ok &= self._RunTestModule(file_path)
line 123, in _RunTestModule
    module = imp.load_module(module_name, *import_tuple)
  File "google/protobuf/internal/symbol_database_test.py", line 36, in 
    from google.protobuf import unittest_pb2
ImportError: cannot import name unittest_pb2

Ignoring the above test failure, I did a sudo python setup.py install.

After this, I'm not able to import the generated proto files. Please see 

message msg {
    required int64 value = 1;

$ protoc --version
libprotoc 2.6.1

$ PYTHONPATH=gen python                                                     
Python 2.7.8 (default, Oct 20 2014, 15:05:19) 
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import msg_pb2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/arun/prototest/gen/msg_pb2.py", line 9, in <module>
    from google.protobuf import symbol_database as _symbol_database
ImportError: cannot import name symbol_database

Any idea where I am going wrong?


You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to