[Python] Iam unable to import scikit module, iam using jupyter notebook on VScode (mind you...

Discussão em 'Python' iniciado por Stack, Maio 17, 2025.

  1. Stack

    Stack Membro Participativo

    I am doing an assignment whose one part asks me to implement OLS using scikit. In VScode, whenever i run the code, it asks for a kernel, i chosed the one which is installed in my original anaconda directory. However on importing scikit it throws an error, it is as follows:

    ModuleNotFoundError Traceback (most recent call last) File d:\progrmin\ml\Lib\site-packages\scipy_init_.py:51 50 try: ---> 51 from scipy.config import show as show_config 52 except ImportError as e:

    ModuleNotFoundError: No module named 'scipy.config'

    The above exception was the direct cause of the following exception:

    ImportError Traceback (most recent call last) Cell In[1], line 1 ----> 1 from sklearn.linear_model import LinearRegression 2 import numpy as np

    File d:\progrmin\ml\Lib\site-packages\sklearn_init_.py:84 70 # We are not importing the rest of scikit-learn during the build 71 # process, as it may not be compiled yet 72 else: (...) 78 # later is linked to the OpenMP runtime to make it possible to introspect 79 # it and importing it first would fail if the OpenMP dll cannot be found. 80 from . import ( 81 __check_build, # noqa: F401 ... 62 # Allow distributors to run custom init code

    ImportError: Error importing SciPy: you cannot import SciPy while being in scipy source directory; please exit the SciPy source tree first and relaunch your Python interpreter.

    A few solutions I found said to change the directory of interpreter , how do I do that? Or my problem is something else

    Continue reading...

Compartilhe esta Página