Yowsup: SyntaxError: invalid syntax under Python 3.4.3

Created on 15 Jun 2015  路  2Comments  路  Source: tgalal/yowsup

I get this when running the code under Python 3.4.3.

[diego@myhost project]$ python run.py
Traceback (most recent call last):
  File "run.py", line 8, in <module>
    from yowsup.stacks import YowStack
  File "/home/diego/.local/lib/python3.4/site-packages/yowsup/stacks/__init__.py", line 1, in <module>
    from .yowstack import YowStack, YowStackBuilder
  File "/home/diego/.local/lib/python3.4/site-packages/yowsup/stacks/yowstack.py", line 22, in <module>
    from yowsup.layers.axolotl import YowAxolotlLayer
  File "/home/diego/.local/lib/python3.4/site-packages/yowsup/layers/axolotl/__init__.py", line 1, in <module>
    from .layer import YowAxolotlLayer
  File "/home/diego/.local/lib/python3.4/site-packages/yowsup/layers/axolotl/layer.py", line 3, in <module>
    from axolotl.util.keyhelper import KeyHelper
  File "/home/diego/.local/lib/python3.4/site-packages/axolotl/util/keyhelper.py", line 3, in <module>
    from ..identitykeypair import IdentityKeyPair
  File "/home/diego/.local/lib/python3.4/site-packages/axolotl/identitykeypair.py", line 1, in <module>
    from .state.storageprotos import IdentityKeyPairStructure
  File "/home/diego/.local/lib/python3.4/site-packages/axolotl/state/storageprotos.py", line 8, in <module>
    from google.protobuf import reflection as _reflection
  File "/home/diego/.local/lib/python3.4/site-packages/google/protobuf/reflection.py", line 68, in <module>
    from google.protobuf.internal import python_message
  File "/home/diego/.local/lib/python3.4/site-packages/google/protobuf/internal/python_message.py", line 848
    except struct.error, e:
                       ^
SyntaxError: invalid syntax
[diego@myhost project]$ 

Most helpful comment

you need to upgrade to protobuf >=2.6

pip install -Iv protobuf==3.0.0-alpha-1

All 2 comments

you need to upgrade to protobuf >=2.6

pip install -Iv protobuf==3.0.0-alpha-1

Thanks @tgalal This fixed my error. Had to rename it to one from the compatible list though.

Could not find a version that satisfies the requirement protobuf==3.0.0-alpha-1 (from versions: 2.0.0b0, 2.0.3, 2.3.0, 2.4.1, 2.5.0, 2.6.0, 2.6.1, 3.0.0a2, 3.0.0a3, 3.0.0b1, 3.0.0b1.post1, 3.0.0b1.post2, 3.0.0b2, 3.0.0b2.post1, 3.0.0b2.post2, 3.0.0b3)
Cleaning up...
No matching distribution found for protobuf==3.0.0-alpha-1

So, pip install -Iv protobuf==3.0.0a3 worked like a charm!

Was this page helpful?
0 / 5 - 0 ratings