scikit-learn can be easily uninstalled using Conda, a popular package manager for Python and R.
This uninstallation procedure will work on Windows, macOS, and Linux platforms where Conda is installed.
To uninstall scikit-learn, simply run the following command in your terminal:
conda remove scikit-learn
To confirm that scikit-learn was successfully uninstalled, you can try importing it in a Python script or interactive shell:
import sklearn
Running the example gives an output like:
ImportError: No module named 'sklearn'
The first code block shows the
conda remove
command to uninstall scikit-learn from the active Conda environment.The second code block attempts to import the
sklearn
library after uninstallation.This results in an
ImportError
, confirming that scikit-learn is no longer installed in the current Python environment.