Getting PyCharm to import sklearn

2020-07-02 08:36发布

Beginner here.

I’m trying to use sklearn in pycharm. When importing sklearn I get an error that reads “Import error: No module named sklearn” The project interpreter in pycharm is set to 2.7.10 (/anaconda/bin/python.app), which should be the right one. Under default preferenes, project interpreter, I see all of anacondas packages. I've double clicked and installed the packages scikit learn and sklearn. I still receive the “Import error: No module named sklearn”

Does anyone know how to solve this problem?

7条回答
▲ chillily
2楼-- · 2020-07-02 09:06

Double check your python interpreter. Check whether you have select correct interpreter at the first when you create the project.

Refer this-Image of checking interpreter when Create project

Or else you can check your interpreter from the project view under External Libraries.

Refer this-Image of checking interpreter from Project view

In your case if you didn't select 2.7.10 (/anaconda/bin/python.app) as your interpreter for the project at the beginning still the program give the same error Import error: No module named sklearn.

查看更多
登录 后发表回答