I know there are several similar questions asked, but mine still remains unanswered.
Here's the problem.
I used the command python3 -m pip3 install -U scikit-learn
to install sklearn
, numpy
, and scipy
.
However, when I run:
import sklearn
from sklearn.linear_model import LogisticRegression
in my file, I got an error message like:
Traceback (most recent call last):
File "sklearn.py", line 4, in <module>
import sklearn
from sklearn.linear_model import LogisticRegression
ModuleNotFoundError: No module named 'sklearn.linear_model'; 'sklearn' is not a package
And strangely, when I run
import sklearn
everything is fine without any error.
In fact, I can't use any of the attributes of sklearn
, and I can only import sklearn
but I can't do anything.
By the way, I run my file on MAC OS terminal with python3
command.