Home > other >  Rookie consult tushare pro, don't understand the problem
Rookie consult tushare pro, don't understand the problem

Time:09-30

Enter
The import tushare as ts
Ts. Set_token (' your token here ')
Display an error
AttributeError: module 'tushare' has no attribute 'set_token'
How to solve?

CodePudding user response:

To ask this, baidu search less than

CodePudding user response:

Should have this function,

Look at your tushare version
Print (ts) __version__)

CodePudding user response:

Or command line PIP show tushare

CodePudding user response:

Speculated that the most possible reason: your test file name is tushare py and to test the library name
Lead to import tushare import not you install tushare library, but your own tushare. Py test file
Thus error

Solution:
The tushare. Py name, such as testToshare. Py,

See I give you write posts:
[remind] Python beginner developers note: test don't and import library with the same name in the file name
  • Related