Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sklearn module not found in anaconda

I've been trying to import sklearn but it says that the module is not found.

my python, numpy, scipy and scikit versions are as follows as show in the conda list:

numpy                     1.14.3           py36h9fa60d3_1

python                    3.6.5                h0c2934d_0

scipy                     1.1.0            py36h672f292_0

scikit-learn              0.19.1           py36h53aea1b_0

the error while trying to import sklearn is:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-2-f2461ba6e1e9> in <module>()
----> 1 from sklearn.family import model

ModuleNotFoundError: No module named 'sklearn.family'

I tried using

conda update scikit-learn

conda install scikit-learn

but I get the following results

All requested packages already installed.

how do I import sklearn then?

like image 987
Madhurjya Avatar asked Aug 31 '18 15:08

Madhurjya


2 Answers

enter image description here

Although there is not skleran module, from sklearn import ... works well in PyCharm:

from sklearn.utils import resample
like image 79
catcoder Avatar answered Oct 21 '22 21:10

catcoder


Try doing

conda install -c anaconda pip
pip install sklearn
like image 34
Adarsha Neupane Avatar answered Oct 21 '22 21:10

Adarsha Neupane