td-ameritrade-python-api
td-ameritrade-python-api copied to clipboard
Error while connectiong to tdstream: AttributeError: module 'websockets' has no attribute 'client'
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.
This fixed my issue too.
Same here, fixed my issue.