SKLearner Home | About | Contact | Examples

Check if Scikit-Learn is Installed

If you’re unsure whether scikit-learn is installed in your Python environment, you can quickly check by attempting to import it in a Python script or by checking the version from the command line.

This procedure will work on Windows, macOS, and Linux. Note that scikit-learn requires Python to be installed. If Python is not installed, checking for scikit-learn is moot.

You can check the scikit-learn version from the command line:

python -c "import sklearn; print(sklearn.__version__)"

Alternatively, create a short Python script that imports sklearn and prints the version:

import sklearn
print(sklearn.__version__)

Running either of these will give an output like:

1.5.0


See Also