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
pip install protobuf should default to cpp_implementation if system headers present #539
Comments
We now distribute python C++ implementations to PyPI and it should be selected automatically by pip. |
Awesome news! Thanks |
I am running sudo pip install protobuf --install-option="--cpp_implementation" on Mac but get errors:
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-_Rgqlb/protobuf/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-TifxqZ-record/install-record.txt --single-version-externally-managed --compile --cpp_implementation" failed with error code 1 in /private/tmp/pip-build-_Rgqlb/protobuf/ |
@swangsc To install python cpp implementation on Mac, you will need to install the C++ runtime first. |
@xfxyjwf I have installed the C++ package following https://github.com/google/protobuf/tree/master/src how can I make sure if the c++ runtime is installed? |
Hmm, I just checked, and it turns out the struil.h header used by pyext/message.cc is not actually installed with protobuf C++ runtime (i.e., it's treated as an internal header). I guess we will need to either make it a public header or update python cpp code to not use it. To workaround it you can install from source by following instructions here: |
Hi X: |
@swangsc Can you run "./setup.py build --cpp_implementation" and then try test again? |
Hi X, I finally installed the c++ implementation based python runtime successfully. I can install it even the tests failed. The performance is awesome. Thanks! |
hi,@swangsc, what's your protobuf version? |
@BreakTom I'm not swangsc, but I believe I'm seeing similar errors or maybe even the same error. On OS X 10.12.5, building from HEAD (097bfb5):
I first built the C++ version, which did not report failures on
which gave me the failures mentioned above. |
I am getting |
@abhimanyu1289 I think you need to install c++ implementation from source code. PIP doesn't support it. |
@swangsc I did install it. But I get the same error. I gave up installing via pip. I installed using setup.py but I am getting this error when I am trying to use my protobufs. |
have you do this: export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp |
yes. I did. |
By the way, I have a PR that should sort out the |
If anyone is still having issues here, ensure your python is compiled for wide-unicode - compile flag |
…s#539) protoc-gen-go: add test for various generation params Add tests for import_prefix and Ma.proto=package.
First draft of new mini-table building API
First draft of new mini-table building API
As of now it requires calling
or
But
protobuf
as a dependency viaprecludes passing a flag along to
setup.py
.(I realize this is somewhat problematic / won't work for users that already have
protobuf
installed without the flag, but at least this will help people in fresh installs.)/cc @tseaver @jgeewax @tbetbetbe
The text was updated successfully, but these errors were encountered: