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

tda-generate-token.py --help fails with ImportError: cannot import name 'USE_CLIENT_DEFAULT' from 'httpx' #275

Open
ddouglas87 opened this issue Oct 27, 2021 · 2 comments

Comments

@ddouglas87
Copy link

I'm reading the guide https://tda-api.readthedocs.io/en/latest/auth.html#fetching-a-token-and-creating-a-client

If you don’t want to create a client and just want to fetch a token, you can use the tda-generate-token.py script that’s installed with the library.

tda-generate-token.py --help

So on my local machine I did pip install tda-api, everything seems fine.

Then I ran tda-generate-token.py --help and the output I get is:

tda-generate-token.py --help
Traceback (most recent call last):
  File "/usr/local/bin/tda-generate-token.py", line 6, in <module>
    import tda
  File "/usr/local/lib/python3.9/site-packages/tda/__init__.py", line 1, in <module>
    from . import auth
  File "/usr/local/lib/python3.9/site-packages/tda/auth.py", line 4, in <module>
    from authlib.integrations.httpx_client import AsyncOAuth2Client, OAuth2Client
  File "/usr/local/lib/python3.9/site-packages/authlib/integrations/httpx_client/__init__.py", line 10, in <module>
    from .oauth2_client import (
  File "/usr/local/lib/python3.9/site-packages/authlib/integrations/httpx_client/oauth2_client.py", line 3, in <module>
    from httpx import AsyncClient, Auth, Client, Request, Response, USE_CLIENT_DEFAULT
ImportError: cannot import name 'USE_CLIENT_DEFAULT' from 'httpx' (/usr/local/lib/python3.9/site-packages/httpx/__init__.py)

I'm using Python 3.9.7 running on MacOS 11.2.1.

@ddouglas87
Copy link
Author

Solution: I updated to Python 3.10.0rc1 and it now works.

@pssolanki111
Copy link
Contributor

@ddouglas87 consider closing the issue ticket now that the issue is resolved.

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

2 participants