REST API client seems buggy
Closed this issue · 6 comments
Describe the bug
I've followed your docs and they appear to be misleading. I installed your client, but it states that it cannot find RESTClient when I run the program.
To Reproduce
Just follow your documentation and try to do any basic command...
Expected behavior
The program should just run...
Screenshots
code pasted below
Additional context
(.venv) ╭─lux@Luminosity ~/Documents/Projects/Python/Tomic_root ‹main●›
╰─$ /Users/lux/Documents/Projects/Python/Tomic_root/.venv/bin/python3 /Users/lux/Documents/Projects/Python/Tomic_root/Tomic/polygon_client.py
Traceback (most recent call last):
File "/Users/lux/Documents/Projects/Python/Tomic_root/Tomic/polygon_client.py", line 8, in
from polygon import RESTClient
ImportError: cannot import name 'RESTClient' from 'polygon' (unknown location)
Please let me know if you need more information
Hi @W1zardsCh3ss, have you run pip install -U polygon-api-client
? What does pip list
say?
Hello,
Yes, I ran that command to install the polygon client.
pip list shows:
polygon-api-client 1.14.2
This is why I'm confused by the error I'm getting:
Traceback (most recent call last):
File "/Users/lux/Documents/Projects/Python/Tomic_root/Tomic/polygon_client.py", line 8, in
from polygon import RESTClient
ImportError: cannot import name 'RESTClient' from 'polygon' (unknown location)
Additionally, I get this when I run pip show:
(.venv) ╭─lux@Luminosity ~/Documents/Projects/Python/Tomic_root ‹main●›
╰─$ pip show polygon-api-client 1 ↵
Name: polygon-api-client
Version: 1.14.2
Summary: Official Polygon.io REST and Websocket client.
Home-page: https://polygon.io
Author: polygon.io
Author-email:
License: MIT
Location: /Users/lux/Documents/Projects/Python/Tomic_root/.venv/lib/python3.12/site-packages
Requires: certifi, urllib3, websockets
Required-by: tomic
Very strange. Can you maybe try reinstalled via:
pip uninstall polygon-api-client
pip install -U polygon-api-client
Also, do you mind posting the script you're using so I can try and reproduce? I don't think I've seen this before Required-by: tomic
how are you installing the client?
Thank you!
I don't fully understand why uninstalling and reinstalling worked, but it did, I am now getting data back to the terminal.
For reference, tomic is the name of the application I'm building, so it's also seen as a package requirement when I run pip install --editable .
Yeah, I'm not sure either. Happy it worked thought.