I am working in VS Code to run a Python script in conda environment named myenv where sklearn is already installed. However when I import it and run the script I get the following error:
Traceback (most recent call last):
File "d:\ML\Project\src\train.py", line 5, in <module>
from sklearn.linear_models import LinearRegression
ModuleNotFoundError: No module named 'sklearn'
I have tried all possible solutions suggested in the following but nothing worked for me:
- ModuleNotFoundError: No module named 'sklearn'
- ModuleNotFoundError: No module named 'sklearn.__check_build._check_build'?
- ImportError in importing from sklearn: cannot import name check_build
- importError: cannot import name __check_build #8754
Can someone suggest a different way to fix this?