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

First run problem Python2.7 - unexpected keyword argument 'syntax' #130

Closed
robertjustjones opened this issue Nov 25, 2016 · 4 comments
Closed

Comments

@robertjustjones
Copy link

robertjustjones commented Nov 25, 2016

I'm getting the following error running the ./example.py script and also interactively on import pychromecast

Traceback (most recent call last):
  File "pychromecast/example.py", line 10, in <module>
    import pychromecast
  File "/Users/.../pychromecast/pychromecast/__init__.py", line 14, in <module>
    from . import socket_client
  File "/Users/.../pychromecast/pychromecast/socket_client.py", line 22, in <module>
    from . import cast_channel_pb2
  File "/Users/.../pychromecast/pychromecast/cast_channel_pb2.py", line 23, in <module>
    serialized_pb=_b('\n\x12\x63\x61st_channel.proto\x12 extensions.core_api.cast_channel\"\xed\x02\n\x0b\x43\x61stMessage\x12W\n\x10protocol_version\x18\x01 \x02(\x0e\x32=.extensions.core_api.cast_channel.CastMessage.ProtocolVersion\x12\x11\n\tsource_id\x18\x02 \x02(\t\x12\x16\n\x0e\x64\x65stination_id\x18\x03 \x02(\t\x12\x11\n\tnamespace\x18\x04 \x02(\t\x12O\n\x0cpayload_type\x18\x05 \x02(\x0e\x32\x39.extensions.core_api.cast_channel.CastMessage.PayloadType\x12\x14\n\x0cpayload_utf8\x18\x06 \x01(\t\x12\x16\n\x0epayload_binary\x18\x07 \x01(\x0c\"!\n\x0fProtocolVersion\x12\x0e\n\nCASTV2_1_0\x10\x00\"%\n\x0bPayloadType\x12\n\n\x06STRING\x10\x00\x12\n\n\x06\x42INARY\x10\x01\"s\n\rAuthChallenge\x12\x62\n\x13signature_algorithm\x18\x01 \x01(\x0e\x32\x34.extensions.core_api.cast_channel.SignatureAlgorithm:\x0fRSASSA_PKCS1v15\"\xc8\x01\n\x0c\x41uthResponse\x12\x11\n\tsignature\x18\x01 \x02(\x0c\x12\x1f\n\x17\x63lient_auth_certificate\x18\x02 \x02(\x0c\x12 \n\x18intermediate_certificate\x18\x03 \x03(\x0c\x12\x62\n\x13signature_algorithm\x18\x04 \x01(\x0e\x32\x34.extensions.core_api.cast_channel.SignatureAlgorithm:\x0fRSASSA_PKCS1v15\"\xa8\x01\n\tAuthError\x12I\n\nerror_type\x18\x01 \x02(\x0e\x32\x35.extensions.core_api.cast_channel.AuthError.ErrorType\"P\n\tErrorType\x12\x12\n\x0eINTERNAL_ERROR\x10\x00\x12\n\n\x06NO_TLS\x10\x01\x12#\n\x1fSIGNATURE_ALGORITHM_UNAVAILABLE\x10\x02\"\xd5\x01\n\x11\x44\x65viceAuthMessage\x12\x42\n\tchallenge\x18\x01 \x01(\x0b\x32/.extensions.core_api.cast_channel.AuthChallenge\x12@\n\x08response\x18\x02 \x01(\x0b\x32..extensions.core_api.cast_channel.AuthResponse\x12:\n\x05\x65rror\x18\x03 \x01(\x0b\x32+.extensions.core_api.cast_channel.AuthError*J\n\x12SignatureAlgorithm\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x13\n\x0fRSASSA_PKCS1v15\x10\x01\x12\x0e\n\nRSASSA_PSS\x10\x02\x42\x02H\x03')
TypeError: __init__() got an unexpected keyword argument 'syntax'

I'm using

macOS Sierra
Python 2.7.11
pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)
(and all requirements are satisfied)

Any ideas short of python3?

@hugovk
Copy link
Contributor

hugovk commented Nov 26, 2016

Looks like #47, but you have latest pip.

It's working for me with:

  • macOS Sierra
  • Python 2.7.12
  • pip 9.0.1 from /usr/local/lib/python2.7/site-packages (python 2.7)

Try moving example.py to a completely different directory, and running it from there. It's may be there's some import confusion between the installed pychromecast and the pychromecast directory in the current working directory.

@theychx
Copy link
Contributor

theychx commented Dec 16, 2016

Have you also installed protobuf with homebrew? Have a look at this.

@clach04
Copy link
Contributor

clach04 commented Oct 6, 2020

Stumbled across #130 and #47. Ended up sticking with Python3 (was simply testing Python 2.7) but did see https://github.com/skorokithakis/catt which documents that catt version 0.5.6 has python 2 support in case anyone really needs Python 2.7 support.

@emontnemery
Copy link
Collaborator

Pychromecast is Python 3 only since quite some time

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