简体   繁体   中英

Why can i not import sklearn

Why am I not able to import sklearn? I downloaded Anaconda Navigator and it has scikit-learn in it. I even pip installed sklearn , numpy and scipy in Command Prompt and it shows that it has already been installed, but still when I import sklearn in Python (I use PyCharm for coding) it doesn't work. It says 'No module named sklearn'.

Your python interpretor in pycharm is probably not pointing to Anaconda's python, but to the system's default.

See this to select the correct python binary.

Problem solved! I didn't know that I was supposed to change my interpreter to Anaconda's interpreter(I am fairly new to Python). Thanks for the help!

If someone is working with via bash here are the steps :

For ubunutu :

sudo apt-get install python-sklearn

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM