José
José

Reputation: 573

Jupyter is not finding sklearn

I am working with Python3 in Spyder and in a Jupyter notebook. When I try to load sklearn in the console of Spyder, for example:

from sklearn.datasets import load_iris

It works fine. But if I do the same thing in Jupyter, it tells me that I don't have this module installed:

from sklearn.datasets import load_iris
ImportError                               Traceback (most recent call last)
<ipython-input-18-daefd108d0e6> in <module>()
----> 1 from sklearn.datasets import load_iris

ImportError: No module named 'sklearn'

I have tried to reinstall with condas and pip3 and they tell me that sklearn is already installed... ¬¬

I have found similar questions in Stackoverflow, but none of them could find an answer. I would be very grateful for any help. Best regards!

Upvotes: 1

Views: 1046

Answers (2)

erickfis
erickfis

Reputation: 1234

Navigate to

C:\Users\XXXX\AppData\Roaming\jupyter

and remove the folder

kernels

It seems that a series of installs/uninstalls causes this problem.

Upvotes: 0

etlsh
etlsh

Reputation: 701

There's a good chance your python and Jupiter use different python versions, can you provide the following output:

import sys
print(sys.version)

for both Jupiter and Spyder

Upvotes: 1

Related Questions