I had the same issue using python 3.11.4
, and installing scikit-learn by pip install sklearn
. My solution was to use pip install scikit-learn
, as shown in the following sequence:
PS C:\Users\Administrador> pip install scikit-learn
Collecting scikit-learn
Obtaining dependency information for scikit-learn from https://files.pythonhosted.org/packages/77/85/bff3a1e818ec6aa3dd466ff4f4b0a727db9fdb41f2e849747ad902ddbe95/scikit_learn-1.3.0-cp311-cp311-win_amd64.whl.metadata
Downloading scikit_learn-1.3.0-cp311-cp311-win_amd64.whl.metadata (11 kB)
Requirement already satisfied: numpy>=1.17.3 in c:\users\administrador\appdata\local\programs\python\python311\lib\site-packages (from scikit-learn) (1.25.2)
Collecting scipy>=1.5.0 (from scikit-learn)
Obtaining dependency information for scipy>=1.5.0 from https://files.pythonhosted.org/packages/04/b8/947f40706ee2e316fd1a191688f690c4c2b351c2d043fe9deb9b7940e36e/scipy-1.11.1-cp311-cp311-win_amd64.whl.metadata
Downloading scipy-1.11.1-cp311-cp311-win_amd64.whl.metadata (59 kB)
---------------------------------------- 59.1/59.1 kB 1.5 MB/s eta 0:00:00
Collecting joblib>=1.1.1 (from scikit-learn)
Obtaining dependency information for joblib>=1.1.1 from https://files.pythonhosted.org/packages/10/40/d551139c85db202f1f384ba8bcf96aca2f329440a844f924c8a0040b6d02/joblib-1.3.2-py3-none-any.whl.metadata
Downloading joblib-1.3.2-py3-none-any.whl.metadata (5.4 kB)
Collecting threadpoolctl>=2.0.0 (from scikit-learn)
Obtaining dependency information for threadpoolctl>=2.0.0 from https://files.pythonhosted.org/packages/81/12/fd4dea011af9d69e1cad05c75f3f7202cdcbeac9b712eea58ca779a72865/threadpoolctl-3.2.0-py3-none-any.whl.metadata
Downloading threadpoolctl-3.2.0-py3-none-any.whl.metadata (10.0 kB)
Downloading scikit_learn-1.3.0-cp311-cp311-win_amd64.whl (9.2 MB)
---------------------------------------- 9.2/9.2 MB 8.4 MB/s eta 0:00:00
Downloading joblib-1.3.2-py3-none-any.whl (302 kB)
---------------------------------------- 302.2/302.2 kB 18.2 MB/s eta 0:00:00
Downloading scipy-1.11.1-cp311-cp311-win_amd64.whl (44.0 MB)
---------------------------------------- 44.0/44.0 MB 9.5 MB/s eta 0:00:00
Downloading threadpoolctl-3.2.0-py3-none-any.whl (15 kB)
Installing collected packages: threadpoolctl, scipy, joblib, scikit-learn
Successfully installed joblib-1.3.2 scikit-learn-1.3.0 scipy-1.11.1 threadpoolctl-3.2.0
Checking the scikit-learn
version in PowerShell:
PS C:\Users\Administrador> python
Python 3.11.4 (tags/v3.11.4:d2340ef, Jun 7 2023, 05:45:37) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sklearn
>>> print(sklearn.__version__)
1.3.0
Checking via cli the scikit-learn
version in a VSCode environment:
