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

Cant get the sdk to run #30

Open
devguyplus opened this issue Sep 23, 2021 · 5 comments
Open

Cant get the sdk to run #30

devguyplus opened this issue Sep 23, 2021 · 5 comments

Comments

@devguyplus
Copy link

Hi,
I have copied the basic example from the readme file, and filled all the details required.
After running it, it returns the following error:

File "sinric\_sinricprosocket.py", line 33, in connect self.connection = await websockets.client.connect('ws://ws.sinric.pro', File "\websockets\imports.py", line 92, in __getattr__ raise AttributeError(f"module {package!r} has no attribute {name!r}") AttributeError: module 'websockets' has no attribute 'client'

@jamesbob1
Copy link

Try adding import websockets before the sinric imports.

@devguyplus
Copy link
Author

Try adding import websockets before the sinric imports.

Like this?
import websockets from sinric import SinricPro from sinric import SinricProUdp import asyncio

It returned the same error.

@kakopappa
Copy link
Contributor

kakopappa commented Sep 23, 2021 via email

@bsalinas
Copy link

For what its worth, I ran into the same problem just now.
In particular, it looks like pip was installing version 2.4.1 of sinricpro which has the line

self.connection = await websockets.client.connect('ws://ws.sinric.pro',

(and imports for import websockets).

It looks like in version 2.4.2, there were some changes to _sinricprosocket.py which switched to imports like

from websockets import client

Manually making those changes in my local copy of _sinricprosocket.py got the examples to run for me.

I am running python 3.9.1.

I am not sure if this is related, but I thought I would mention it in case it was a helpful observation.

@dhilmer
Copy link

dhilmer commented Jan 14, 2022

Thanks @bsalinas I was having the same issue and that worked for me!

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