看到:
以为是其他什么问题呢
帮其搜索:
tushare
module tushare has no attribute set_token
“估计你的文件名叫tushare.py, 改个名就好了.”
->那估计是这个问题了:小白测试python时,把测试文件,写成了:tushare.py
和要测试的库tushare,重名了。
导致Python解析器去解析代码import tushare as ts
变成自己的测试文件tushare.py
而不是要测试的库:tushare了。
也看到了别的类似的例子import tushare as ts
print(ts.__version__)
提示错误##########
D:\Programs\Anaconda3\python.exe D:/PythonWorks/PycharmProjects/Stocks/tushare.py
Traceback (most recent call last):
File "D:/PythonWorks/PycharmProjects/Stocks/tushare.py", line 1, in <module>
import tushare as ts
File "D:\PythonWorks\PycharmProjects\Stocks\tushare.py", line 2, in <module>
print(ts.__version__)
AttributeError: module 'tushare' has no attribute '__versio