Import sklearn- getting an issue

on writing ‘from sklearn.datasets import load_boston’
i am getting this error

ImportError Traceback (most recent call last)
in
----> 1 from sklearn.datasets import load_boston

c:\users\hp laptop\appdata\local\programs\python\python38\lib\site-packages\sklearn_init_.py in
77 # it and importing it first would fail if the OpenMP dll cannot be found.
78 from . import _distributor_init # noqa: F401
—> 79 from . import __check_build # noqa: F401
80 from .base import clone
81 from .utils._show_versions import show_versions

ImportError: cannot import name '_check_build’ from partially initialized module ‘sklearn’ (most likely due to a circular import) (c:\users\hp laptop\appdata\local\programs\python\python38\lib\site-packages\sklearn_init.py)

hey @mehta.rashita18,
its mainly because of some modules not being available for proper working of sklearn .
try re-installing sklearn along with scipy module . I hope it would work then.

Hi,
Thanku for replying
I tried the same, uninstalling and then re installing sklearn, but it is still showing the same error
how to resolve this now?

I installed scipy module too

just try the below code and kindly tell me if there is any error , if yes then what the error is .

import sklearn
import scipy


just see this screenshot to know what error it is actually showing

  1. pip uninstall sklearn
  2. pip uninstall scikit-learn
  3. pip install sklearn

its going a bit complicated now,
try these once.

The issue is resolved…thank you so much for your time

what was the solution ?

i Did the same What you said

okay.

Kindly mark this doubt as resolved in doubt section and do provide your valuable feedback as it will help us to improve this platform and provide you with better learning experience.
Thank You.
Happy Coding :slightly_smiling_face:.