Every Python virtual environment keeps its own copy of scikit-learn, so two projects on one machine can import different releases. The installed version reported by a project's own interpreter settles which release that code runs, and the dependency details printed with it complete a bug report.

The package installs as scikit-learn but imports as sklearn. The sklearn.__version__ attribute comes from the library the interpreter actually loads, while sklearn.show_versions() adds the interpreter path, the versions of dependencies such as NumPy and SciPy, and the threading libraries in use. The scikit-learn issue instructions ask for that report when you file a bug.

scikit-learn must already be installed in the environment your project runs from, because an interpreter outside it can fail with a missing-module error or report another project's release. Both queries only import the library and print values, leaving the environment's packages unchanged.

Steps to check the installed scikit-learn version:

  1. Activate the virtual environment from your project directory.
    $ source .venv/bin/activate

    Replace .venv if your project uses another directory name. Use .venv\Scripts\activate on Windows, or conda activate <env-name> for a conda environment.

  2. Print the scikit-learn version from the active interpreter.
    $ python -c "import sklearn; print(sklearn.__version__)"
    1.9.1

    The number shown is the release this environment imports, and it can differ in another project. A ModuleNotFoundError for sklearn means this interpreter has no scikit-learn, so no version is reported until the right environment is active or the package is installed there.
    Related: How to fix the No module named sklearn error in scikit-learn

  3. Print the full version report to confirm the interpreter and its dependencies.
    $ python -c "import sklearn; sklearn.show_versions()"
    
    System:
        python: 3.12.16 (main, Nov  5 2026, 08:06:14) [GCC 14.2.0]
    executable: /home/user/project/.venv/bin/python
       machine: Linux-7.0.14-linuxkit-aarch64-with-glibc2.41
    
    Python dependencies:
          sklearn: 1.9.1
              pip: 25.0.1
       setuptools: None
            numpy: 2.5.4
            scipy: 1.18.1
           Cython: None
           pandas: None
       matplotlib: None
           joblib: 1.6.0
    threadpoolctl: 3.8.0
         narwhals: 2.28.0
    
    Built with OpenMP: True
    
    threadpoolctl info:
           user_api: openmp
       internal_api: openmp
        num_threads: 8
             prefix: libgomp
           filepath: /home/user/project/.venv/lib/python3.12/site-packages/scikit_learn.libs/libgomp-a49a47f9.so.1.0.0
            version: None
    
    ##### snipped #####

    A success shows the executable path inside your project's environment and the same sklearn version as the previous step. None beside a listed package means that package is not installed in this environment. The executable and filepath lines can reveal your username and project directory in a public issue.

Share this guide