-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Python 3 SyntaxError #882
Comments
Is this the full stack trace? What is the error message of the exception? |
it's not a exception, it's syntax error !!! it should be "except (struct.error, e):" , I tried to correct it myself but there are too many error of syntax (syntax python2 in python3 package). Thx to fix it plz |
You can manually convert with 2to3 all the files by hand, but why is this package advertised as python 3 compatible and why is it available via pip for python 3? |
This issue happens for me too. Simple test is to confirm is just to run a compiled protocol buffer python file directly. Same syntax error occurs. Pip freeze shows 'protobuf==2.6.1' |
That last stable release (2.6.1) doesn't support python3. For python3, you need to install the latest beta versions: $ pip3 install protobuf==3.0.0b2 Since it's beta, it's not automatically picked up by "pip3 instal protobuf" and you need to set the version number explicitly. |
Yes there is a lot of syntax errors, if you don't want to handle yourself use python2 |
i have compiled caffe on Ubuntu 16.04 LTS both with python 2 and python, it is really a hectic process for beginners, for caffe with python 2.7 make sure that your /.local/lib/python2.7/site-packages only contains a version same as you protoc version. protoc version can be checked by entering
or another protobuf such as 3.5 version of protobuf. hope everything works OK for you. |
After doing a
pip3 install protobuf
, when I try to use the package I get this SyntaxError:Why there is a package for python3, if python3 is not supported?
The text was updated successfully, but these errors were encountered: