Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile and install python module failed #34

Closed
Catstyle opened this issue Sep 23, 2014 · 10 comments
Closed

compile and install python module failed #34

Catstyle opened this issue Sep 23, 2014 · 10 comments
Milestone

Comments

@Catstyle
Copy link

download release packege from https://protobuf.googlecode.com/svn/rc/protobuf-2.6.0.tar.gz
yeah, for some all we known reasons i cannot build from git source because it need to download gtest from google site

./configure && make && make install && ldconfig
protoc installed successfully, then go to install python module

cd python
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2
python setup.py build --cpp_implementation && python setup.py test --cpp_implementation && python setup.py install --cpp_implementation

indeed it said all goes well, but when i tried my app, it complained that missing pyext
ah... something wrong!
then i took a look at the protobuf egg, it DID HAVE NO pyext module
am i doing wrong?

@Catstyle
Copy link
Author

Traceback (most recent call last):
  File "generate_lua.py", line 8, in <module>
    from google.protobuf import descriptor_pb2
  File "/usr/local/lib/python2.7/dist-packages/protobuf-2.6.0-py2.7-linux-x86_64.egg/google/protobuf/descriptor_pb2.py", line 8, in <module>
    from google.protobuf import reflection as _reflection
  File "/usr/local/lib/python2.7/dist-packages/protobuf-2.6.0-py2.7-linux-x86_64.egg/google/protobuf/reflection.py", line 60, in <module>
    from google.protobuf.pyext import cpp_message
ImportError: cannot import name cpp_message

it seems somewhere need to import pyext.cpp_message, then go to
https://github.com/google/protobuf/blob/master/python/google/protobuf/reflection.py#L60
i do export two environments above

@Catstyle
Copy link
Author

oops...
i just find #3 now, it do resolve my problem

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Oct 2, 2014

Fixed by pr #3

@foebu
Copy link

foebu commented Apr 28, 2015

Hi, how did you fix it in the end? I didn't get it. I still get the error.
Thank you.

@xfxyjwf
Copy link
Contributor

xfxyjwf commented Apr 28, 2015

@foebu, a file was missing from the setup.py script. We added that file in the fix.

@foebu
Copy link

foebu commented Apr 28, 2015

@xfxyjwf I still get the error, though, and I downloaded the release 2.6.1. It seems that in pyext.cpp_message a pyext._message is imported, but the pyext._message module doesn't exist. I'm not an expert, though.

@burner-
Copy link

burner- commented May 30, 2015

check that you run setup.py google_test not setup.py test

@foebu
Copy link

foebu commented Jun 2, 2015

Now, that works. But if that is the standard test, then this readme needs to be changed: https://github.com/google/protobuf/tree/master/python
Thank you, though!

@xiaofeng-gg
Copy link

On Tue, Jun 2, 2015 at 1:44 AM, foebu notifications@github.com wrote:

Now, that works. But if that is the standard test, then this readme needs
to be changed: https://github.com/google/protobuf/tree/master/python
Thank you, though!

Note that in 2.6.1 release, the readme does say using "google_test":
https://github.com/google/protobuf/tree/v2.6.1/python

This has been changed in recent releases though.


Reply to this email directly or view it on GitHub
#34 (comment).

@foebu
Copy link

foebu commented Jun 2, 2015

My bad then, I was reading a different readme :) Sorry.

TeBoring pushed a commit to TeBoring/protobuf that referenced this issue Jan 19, 2019
Changed parser semantics around skipping.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants