SKLearner Home | About | Contact | Examples

Check Scikit-Learn Installation Location

Checking the installation location of scikit-learn can be useful for troubleshooting or confirming the correct version is being used in a Python environment.

The procedure uses Python’s built-in inspect module and will work across Windows, macOS, and Linux platforms.

python -c "import inspect; import sklearn; print(inspect.getfile(sklearn))"

Alternatively:

import inspect
import sklearn

print(inspect.getfile(sklearn))

Running the example gives an output like:

/usr/local/lib/python3.12/site-packages/sklearn/__init__.py


See Also