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 thanCodePudding user response:
Should have this function,Look at your tushare version
Print (ts) __version__)
CodePudding user response:
Or command line PIP show tushareCodePudding user response:
Speculated that the most possible reason: your test file name is tushare py and to test the library nameLead 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