Both commands 'pip uninstall sklearn scikit-learn' are stuck, how to delete it properly?
Question:
import sklearn
sklearn.__file__
'C:\Users\Kenzhegaliyev_EK\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\__init__.py'
the pkg name is sklearn.
I tried both
pip uninstall sklearn
pip uninstall scikit-learn
but either of the 2 is just stuck and completing.
How to delete and install sklearn = 0.19.1
?
Answers:
You can use:
pip install --upgrade sklearn==0.19.1.
To fully answer your question, I dont know why pip uninstall is not working for you. This can be an alternative though.
As far as I can see you are running pip
on Windows and I am assuming you are using cygwin
. It might be the case that some of the messages are not visible. When pip
hangs normally it would ask you “Do you want to continue (y/n)”?
Simply press y
when the uninstalling process hangs and it should do the trick.
Alternatively, you can force it by running:
pip uninstall sklearn --yes
or
pip uninstall scikit-learn --yes
Finally, if you just need to upgrade sklearn
to version 0.19.1
, you don’t have to uninstall the older version; You just need to run the following:
pip install --upgrade sklearn==0.19.1
If you are using Google Colab, use command like:
!pip install scikit-learn==1.1
This will automatically uninstall the current version 1.2
import sklearn
sklearn.__file__
'C:\Users\Kenzhegaliyev_EK\AppData\Local\Continuum\anaconda3\lib\site-packages\sklearn\__init__.py'
the pkg name is sklearn.
I tried both
pip uninstall sklearn
pip uninstall scikit-learn
but either of the 2 is just stuck and completing.
How to delete and install sklearn = 0.19.1
?
You can use:
pip install --upgrade sklearn==0.19.1.
To fully answer your question, I dont know why pip uninstall is not working for you. This can be an alternative though.
As far as I can see you are running pip
on Windows and I am assuming you are using cygwin
. It might be the case that some of the messages are not visible. When pip
hangs normally it would ask you “Do you want to continue (y/n)”?
Simply press y
when the uninstalling process hangs and it should do the trick.
Alternatively, you can force it by running:
pip uninstall sklearn --yes
or
pip uninstall scikit-learn --yes
Finally, if you just need to upgrade sklearn
to version 0.19.1
, you don’t have to uninstall the older version; You just need to run the following:
pip install --upgrade sklearn==0.19.1
If you are using Google Colab, use command like:
!pip install scikit-learn==1.1
This will automatically uninstall the current version 1.2