Pycharm2017.2 anaconda4.4 x64 and bring python3.6.1 normal installation,
PIP install tushare is normal, the project interpreter can see tushare0.87 in the list, Ipython also can import can run,
But in pycharm, the most simple code
The import tushare as ts
Print (ts) __version__)
Prompt error # # # # # # # # # #
D: \ designed \ Anaconda3 \ python exe D:/PythonWorks/PycharmProjects/Stocks/tushare. Py
Traceback (the most recent call last) :
The File "D:/PythonWorks/PycharmProjects/Stocks/tushare. Py", line 1, the in & lt; module>
The import tushare as ts
The File "D: \ PythonWorks \ PycharmProjects \ Stocks \ tushare py", line 2, the in & lt; module>
Print (ts) __version__)
AttributeError: module 'tushare' has no attribute '__version__'
The Process finished with exit code 1
# # # # # # # # # # # great god help me, thank you first,
CodePudding user response:
Thank you for your help, should find out why theInstall all the software and modules are normal, but writing code file named tushare. Py, module not tushare to estimate the runtime are imported, but the tushare. Py file itself, so can't find the __version__ method, the file name can run normally,
CodePudding user response:
Specific how to operate, pleaseCodePudding user response:
Is the reply before:Rookie consult tushare pro, don't understand the question - CSDN BBS
Later, found that this post is the same problem:
Reason: the test file name and the library name repetition,
Solution: test file name, such as from tushare. Py tushareDemo instead. Py
Novice hope have a good look at I wrote:
[remind] Python beginner developers note: test file names don't and import library name