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

Error while connectiong to tdstream: AttributeError: module 'websockets' has no attribute 'client' #238

Open
saber-be opened this issue Apr 6, 2022 · 2 comments

Comments

@saber-be
Copy link
Contributor

saber-be commented Apr 6, 2022

I'm trying to connect to the stream on ubuntu 20.04 and python3.8
Traceback (most recent call last):
...
File "services/TDAmery/AccountActivityStreamListener.py", line 18, in read_stream
await stream_client.build_pipeline()
File "/home/ubuntu/news-miner/venv/lib/python3.8/site-packages/td/stream.py", line 500, in build_pipeline
await self._connect()
File "/home/ubuntu/news-miner/venv/lib/python3.8/site-packages/td/stream.py", line 631, in _connect
self.connection = await websockets.client.connect(self.websocket_url)
File "/home/ubuntu/news-miner/venv/lib/python3.8/site-packages/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'

I fixed this issue by adding this line to td/stream.py line 14:

import websockets.client

If it's ok, I'll create a pull request.

@Boggartfly
Copy link

This fixed my issue too.

@sopko16
Copy link

sopko16 commented Jul 25, 2022

Same here, fixed my issue.

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

3 participants