You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The first time I tried to do 'python setup.py build' it failed; I had to install setuptools which I did with:
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
then I continued with:
python setup.py build
python setup.py google_test
This last step fails with "cannot import name unittest_pb2", full error below.
This fails on two different Ubuntu machines (both of which had proto 2.5 / pure-Python bindings installed before), but succeeds on two MacOS X machines (Mavericks and Yosemite; again both had 2.5 already).
Any help greatly appreciated!
Full error:
running build_ext
Traceback (most recent call last):
File "setup.py", line 200, in
"Protocol Buffers are Google's data interchange format.",
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line 142, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line 122, in with_project_on_sys_path
File "/build/protobuf-2.6.1/python/google_apputils-0.4.1-py2.7.egg/google/apputils/setup_command.py", line 157, in run_tests
ok &= self._RunTestModule(file_path)
File "/build/protobuf-2.6.1/python/google_apputils-0.4.1-py2.7.egg/google/apputils/setup_command.py", line 123, in _RunTestModule
module = imp.load_module(module_name, *import_tuple)
File "google/protobuf/internal/message_test.py", line 53, in
from google.protobuf import unittest_pb2
ImportError: cannot import name unittest_pb2
The text was updated successfully, but these errors were encountered:
I had to delete the earlier protobuf installation:
$ sudo rm -r /usr/lib/python2.7/dist-packages/google
I'm not sure why that wasn't required on the macs, but it worked on both Ubuntu machines.
I also had to update ldconfig (I was getting "libprotobuf.so.9: cannot open shared object file: No such file").
$ sudo echo "/usr/local/lib" > /etc/ld.so.conf.d/local-libproto.conf
$ sudo ldconfig
For my sake this issue is closed. However, it may be an issue that on some platforms the system Python libraries are picked up before the local/build ones, by setup.py.
Steps:
Download v2.6.1 from https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
./configure && make && make check && sudo make install
protoc --version reports 2.6.1
The first time I tried to do 'python setup.py build' it failed; I had to install setuptools which I did with:
wget https://bootstrap.pypa.io/ez_setup.py -O - | sudo python
then I continued with:
python setup.py build
python setup.py google_test
This last step fails with "cannot import name unittest_pb2", full error below.
This fails on two different Ubuntu machines (both of which had proto 2.5 / pure-Python bindings installed before), but succeeds on two MacOS X machines (Mavericks and Yosemite; again both had 2.5 already).
Any help greatly appreciated!
Full error:
running build_ext
Traceback (most recent call last):
File "setup.py", line 200, in
"Protocol Buffers are Google's data interchange format.",
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line 142, in run
File "build/bdist.linux-x86_64/egg/setuptools/command/test.py", line 122, in with_project_on_sys_path
File "/build/protobuf-2.6.1/python/google_apputils-0.4.1-py2.7.egg/google/apputils/setup_command.py", line 157, in run_tests
ok &= self._RunTestModule(file_path)
File "/build/protobuf-2.6.1/python/google_apputils-0.4.1-py2.7.egg/google/apputils/setup_command.py", line 123, in _RunTestModule
module = imp.load_module(module_name, *import_tuple)
File "google/protobuf/internal/message_test.py", line 53, in
from google.protobuf import unittest_pb2
ImportError: cannot import name unittest_pb2
The text was updated successfully, but these errors were encountered: