# Installing Python package sklearn fails

**URL:** <https://discourse.slicer.org/t/installing-python-package-sklearn-fails/27825>\
**Category:** Support\
**Tags:** python\
**Created:** [February 15, 2023, 12:59pm UTC](https://discourse.slicer.org/t/installing-python-package-sklearn-fails/27825 "2023-02-15T12:59:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [February 15, 2023, 12:59pm UTC](https://discourse.slicer.org/t/installing-python-package-sklearn-fails/27825/1 "2023-02-15T12:59:40Z")

</div>

I’ve noticed that a module we have in SlicerHeart that uses `sklearn` always wants to install it. I tried to uninstall it and reinstall it, but import failed. Cleared the pip cache (`PythonSlicer.exe -m pip cache remove *`) but no improvement.

I tried it with the latest stable 5.2.1 and unfortunately it seems that after fresh-installing it and trying to import does not work:

```auto
>>> pip_install('sklearn')
[Python] Collecting sklearn
[Python] Using cached sklearn-0.0.post1.tar.gz (3.6 kB)
[Python] Preparing metadata (setup.py): started
[Python] Preparing metadata (setup.py): finished with status 'done'
[Python] Building wheels for collected packages: sklearn
[Python] Building wheel for sklearn (setup.py): started
[Python] Building wheel for sklearn (setup.py): finished with status 'done'
[Python] Created wheel for sklearn: filename=sklearn-0.0.post1-py3-none-any.whl size=2936 sha256=168c9171f79b986e006af58f4393c3dc817caf4e274bda64939d7f363f7135d4
[Python] Stored in directory: c:\users\pinte\appdata\local\pip\cache\wheels\03\8b\6f\9f13c705de81a6b351b718b3cf917e41ad7c0933c8630d4dd4
[Python] Successfully built sklearn
[Python] Installing collected packages: sklearn
[Python] Successfully installed sklearn-0.0.post1
[Python] [notice] A new release of pip available: 22.3 -> 23.0
[Python] [notice] To update, run: python-real.exe -m pip install --upgrade pip
>>> import sklearn
Traceback (most recent call last):
File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'sklearn'

```

It’s a bit suspicious that the version number is 0.0, but I’m not familiar with sklearn so not sure if this means nightly or what… Any ideas? Thank you!

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [February 15, 2023, 5:16pm UTC](https://discourse.slicer.org/t/installing-python-package-sklearn-fails/27825/2 "2023-02-15T17:16:20Z")

</div>

You are confusing 2 packages. PyPI name sklearn ([sklearn · PyPI](https://pypi.org/project/sklearn/)) is not the same as PyPI name scikit-learn ([scikit-learn · PyPI](https://pypi.org/project/scikit-learn/)). Both use the same `import sklearn` type though when used.

`pip_install('scikit-learn')` is what you need.
