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

cannot import name 'TDClient' from 'td.client' #7

Open
iomega15 opened this issue Feb 20, 2022 · 4 comments
Open

cannot import name 'TDClient' from 'td.client' #7

iomega15 opened this issue Feb 20, 2022 · 4 comments

Comments

@iomega15
Copy link

iomega15 commented Feb 20, 2022

Hello, I am having the following issue when I run the example from GIT:

runfile('C:/Users/iomega15/Desktop/td_example/using_td_library_git.py', wdir='C:/Users/iomega15/Desktop/td_example')
Reloaded modules: config, iomega15
Traceback (most recent call last):

File "C:\Users\iomega15\Desktop\td_example\using_td_library_git.py", line 25, in
client_id = config.get('main', 'client_id')

File "C:\Users\iomega15\anaconda3\lib\configparser.py", line 781, in get
d = self._unify_values(section, vars)

File "C:\Users\iomega15\anaconda3\lib\configparser.py", line 1149, in _unify_values
raise NoSectionError(section) from None

NoSectionError: No section: 'main'

runfile('C:/Users/iomega15/Desktop/td_example/using_td_library.py', wdir='C:/Users/iomega15/Desktop/td_example')
Traceback (most recent call last):

File "C:\Users\iomega15\Desktop\td_example\using_td_library.py", line 15, in
from td.client import TDClient

ImportError: cannot import name 'TDClient' from 'td.client' (C:\Users\iomega15\anaconda3\Lib\site-packages\td\client.py)

I have also tried running it the youtube video way, but I get this issue:

ImportError: cannot import name 'TDClient' from 'td.client' (C:\Users\iomega15\anaconda3\Lib\site-packages\td\client.py)

I saw in the comments that it was a bug in the older version, but that was like a year ago and I just installed/updated the latest (as far as I can tell) from github: Successfully installed td-ameritrade-python-api-0.3.5

Though, I am a bit confused what the actual latest version is, because the github website says:
image

And in your youtube comments from a year ago you mentioned upgrading to 0.2.8 to eliminate this issue...

@granthooks
Copy link

There are 2 projects.
td-ameritrade-python-api
td-ameritrade-api

It looks like td-ameritrade-python-api (which was v0.3.5) was sunset and now @areed1192 has been working on td-ameritrade-api (v0.1.1)
Thank you for the great/useful module Alex!

Your Issue here is the same underlying problem as in this Discussion (td module not recognized)
#9
Hoping for some community input to get this working.

@dillondriskill
Copy link

I think there may be an issue somewhere that's not letting pip install the client.py credentials.py and session.py scripts which is weird

However if you install it as editable by cloning this repo, and from within the root of the repo doing pip install -e . it should work. This is either a bug/error or intentional because the project isn't quite done yet.

@dillondriskill
Copy link

The most recent merge/commit #837315d has fixed this.

@akshaygulabrao
Copy link

akshaygulabrao commented Jul 7, 2022

Make sure td-ameritrade-python-api is uninstalled with
pip uninstall td-ameritrade-python-api.

This fixed the issue for me. Then follow the instructions provided in the ReadMe.

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

4 participants