Issue
I wanted to build a simple model that does Linear and Polynomial regression so I have to have sklearn
imports. So I installed the packages using pip install scikit-learn
and pip install sklearn
and they get installed successfully. But when I run the cell containing the imports (I am writing in Jupyter Notebook) it still doesn't find the module sklearn
.
I tried uninstalling and installing the packages one by one, I tried installing them as if in a requirements.txt file so I have no idea what else to do.
Solution
Often to insure the installations are done in the environment where kernel backing your active Jupyter is running, you can install from within the running .ipynb
file with the magic versions of the install commands. Try making a new cell in your notebook where you want to import and run %pip install sklearn scikit-learn
. Restart the kernel after that runs in its entirety and then try the import commands. See here for more about the magic install commands.
This was @Wayne solution in the comments.
Answered By - M.Ismail
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.