Skip to content

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

Description

@Saber-Bej

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions