Issue
I am new to python and installed it in windows OS and while following Google's machine learning tutorial on youtube, i encountered an error while importing the scikit package.
I installed the Anaconda package as shown in the tutorial but when importing sklearn i get an import error.
import sklearn
i also tried
from sklearn import tree
This is the error
Traceback (most recent call last):
File "C:\Users\Raj Asha\Desktop\hello-world.py", line 2, in <module>
from sklearn import tree
ModuleNotFoundError: No module named 'sklearn'
python version is 3.6.1
link to tutorial video https://www.youtube.com/watch?v=cKxRvEZd3Mw
Solution
Do you use Windows? From the error that you posted I say yes.
Open your terminal (cmd) and try these before you try to import the sklearn.
pip install -U scikit-learn
or
conda install scikit-learn
Also make sure your have numpy and scipy:
pip install numpy
pip install scipy
EDIT
The conda error means that the conda is not in you PATH environment.
To solve this, Uninstall Anaconda and install it again, this time by selecting BOTH the options in the installation instruction as shown:
EDIT 2
If you do not have pip
then, download from here the get-pip.py
file and then use cmd to run python get-pip.py
inside the folder in which get-pip.py is saved
Answered By - seralouk
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.