My Computer small white one, recently learned Python, in trying to learn the text classification model encountered a problem, on the Pycharm import sklearn problem.
I consolidated anaconda this package on the pycharm2017.3 and installed anaconda2 and Anaconda3, anaconda2 as the default interpreter, and the corresponding version is python2.7. When importing the Sklearn library on Pycharm, the following problems exist (not my picture, but similar), see figure:
I am running at the command prompt there is no problem, began to think that pycharm installation problems, so reinstall once, unresolved, and think it may be the problem of the interpreter, adjusted a bit, also did not solve, find half a day to find the reason.
Here's how to view the Interpreter location: (run this code separately from the command prompt and Pycharm)
Import Sys
Print (sys.executable)
The workaround is as follows:
The first step: Uninstall all the original configuration
Pip Uninstall Scikit-learn
Pip Uninstall NumPy
Pip Uninstall scipy
Step two: Download the WHL file corresponding to the Python version
Download Address: https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
As for how to install can refer to my another blog post: http://blog.csdn.net/qq_26591517/article/details/79080787
Step three: Run again, no longer the error, success.
To sum up, you generally see the module does not have a function, not you create a file with the same name is the download of the library has a problem. When you encounter a similar problem, most of the time you want to download the Third-party library again.