-
Hello, I was following along the YouTube videos on using this API and ran into a snag when I got to the Streaming API portion. I'm running python 3.9.0 on my macOS Big Sur 11.3. I installed using python -m pip install td-ameritrade-python-api so it would install all needed dependencies with my python 3.9.0 framework. The code I am running (comments removed to avoid comments turning into markdown headers) is:
The result I'm getting is: Traceback (most recent call last):
I've confirmed that the websockets/client.py file exists. Digging around on google/stack overflow they said this could be from needing websocket-client installed but when I installed that it still didn't resolve the issue. Tried uninstalling websockets and websocket-client and just having one or the other installed, tried having both installed, and none of this resolved the issue. Has anyone else run into this or have suggestions? Thanks in advance! EDIT: I thought perhaps this was due to an environment issue so I went ahead and installed Anaconda. I then followed these steps:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I found a workaround on this but it doesn't seem like it should be needed. Granted I'm pretty new overall to python. I opened the td/stream.py file and right beneath: I put in the following line of code: I ran the script I created and successfully received my streaming quotes. |
Beta Was this translation helpful? Give feedback.
I found a workaround on this but it doesn't seem like it should be needed. Granted I'm pretty new overall to python.
I opened the td/stream.py file and right beneath:
import websockets
I put in the following line of code:
from websockets import client
I ran the script I created and successfully received my streaming quotes.