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

ImportError: cannot import name 'get_chromecast' #4

Closed
sbolten opened this issue Apr 4, 2017 · 6 comments
Closed

ImportError: cannot import name 'get_chromecast' #4

sbolten opened this issue Apr 4, 2017 · 6 comments
Assignees
Labels

Comments

@sbolten
Copy link

sbolten commented Apr 4, 2017

When trying to call connector.py I get the following error:


Traceback (most recent call last):
  File "./connector.py", line 4, in <module>
    from handler.event import EventHandler
  File "/home/stephan/chromecast_mqtt/chromecast-mqtt-connector/handler/event.py", line 1, in <module>
    from handler.adapter import ChromecastConnection, ChromecastConnectionCallback
  File "/home/stephan/chromecast_mqtt/chromecast-mqtt-connector/handler/adapter.py", line 2, in <module>
    from pychromecast import get_chromecast, ChromecastConnectionError, IDLE_APP_ID
ImportError: cannot import name 'get_chromecast'

Output of pip3 freeze:

enum-compat==0.0.2
netifaces==0.10.4
numpy==1.8.2
paho-mqtt==1.2.1
Pillow==2.6.1
protobuf==3.2.0
PyChromecast==0.8.1
requests==2.13.0
RTIMULib==7.2.1
sense-hat==2.2.0
six==1.10.0
zeroconf==0.19.0

Problematic line seems to be:

from handler.event import EventHandler

Since I am not a python guy I have no clue how to fix it.

Regards,

Stephan

@nohum nohum self-assigned this Apr 4, 2017
@nohum
Copy link
Owner

nohum commented Apr 4, 2017

Hello!

Thanks for reporting, the PyChromecast library has been updated, so for the moment your PyChromecast installation is too new.

You can fix this for the moment being by uninstalling PyChromecast and installing a working specific version like so:

pip3 install PyChromecast==0.7.7

Thanks for reporting, I will look into that.

@nohum nohum added the bug label Apr 4, 2017
nohum added a commit that referenced this issue Apr 4, 2017
@nohum
Copy link
Owner

nohum commented Apr 4, 2017

Actually, I fixed the problem in the branch #4-fix-old-pychromecast if you want to try it out without needing to downgrade anything.

@sbolten
Copy link
Author

sbolten commented Apr 4, 2017

Found the problem - had to install an older version of pychromecast --> 0.7.7. All versions above do not have the get_chromecast thing.....

sudo pip3 install pychromecast==0.7.7

Anyhow the chromecast-mqtt-connector progs should be able to run against the latest version of pychromecast.

Stephan

@nohum
Copy link
Owner

nohum commented Apr 4, 2017

@sbolten See the two comments and the branch above ;)

@sbolten
Copy link
Author

sbolten commented Apr 4, 2017

Seems that I found the "bug" while you fixed it - thank anyway... :-)

Will try your fix later. Thx again - great support.

@sbolten
Copy link
Author

sbolten commented Apr 4, 2017

Works like a charm with the fix branch.....

@sbolten sbolten closed this as completed Apr 4, 2017
nohum added a commit that referenced this issue Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants