am trying to install scikit-learn
and pandas
using pip on my Windows machine, but I keep encountering the following error. I tried reinstalling pip, but the issue persists. Here’s what I’ve done so far:
C:WindowsSystem32> pip install scikit-learn
Collecting scikit-learn
Using cached scikit_learn-1.5.1.tar.gz (7.0 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [71 lines of output]
Collecting meson-python>=0.16.0
Using cached meson_python-0.16.0-py3-none-any.whl.metadata (4.1 kB)
Collecting Cython>=3.0.10
Using cached Cython-3.0.11-py2.py3-none-any.whl.metadata (3.2 kB)
Collecting numpy>=2.0.0rc2
Using cached numpy-2.1.1-cp311-cp311-mingw_x86_64.whl
Collecting scipy>=1.6.0
Using cached scipy-1.14.1.tar.gz (58.6 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
Preparing metadata (pyproject.toml) did not run successfully.
exit code: 1
[40 lines of output]
+ meson setup C:UsersNhoxboonAppDataLocalTemppip-install-vye30m4uscipy_7ccac87e7a8d4346b9d9d86617c5a860 C:UsersNhoxboonAppDataLocalTemppip-install-vye30m4uscipy_7ccac87e7a8d4346b9d9d86617c5a860.mesonpy-f5huf210 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:UsersNhoxboonAppDataLocalTemppip-install-vye30m4uscipy_7ccac87e7a8d4346b9d9d86617c5a860.mesonpy-f5huf210meson-python-native-file.ini
The Meson build system
Version: 1.5.1
Source dir: C:UsersNhoxboonAppDataLocalTemppip-install-vye30m4uscipy_7ccac87e7a8d4346b9d9d86617c5a860
Build dir: C:UsersNhoxboonAppDataLocalTemppip-install-vye30m4uscipy_7ccac87e7a8d4346b9d9d86617c5a860.mesonpy-f5huf210
Build type: native build
Project name: scipy
Project version: 1.14.1
C compiler for the host machine: cc (gcc 13.2.0 "cc (Rev2, Built by MSYS2 project) 13.2.0")
C linker for the host machine: cc ld.bfd 2.41
C++ compiler for the host machine: c++ (gcc 13.2.0 "c++ (Rev2, Built by MSYS2 project) 13.2.0")
C++ linker for the host machine: c++ ld.bfd 2.41
Cython compiler for the host machine: cython (cython 3.0.11)
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python found: YES (C:msys64mingw64binpython.exe)
Did not find pkg-config by name 'pkg-config'
Found pkg-config: NO
Run-time dependency python found: YES 3.11
Program cython found: YES (C:UsersNhoxboonAppDataLocalTemppip-build-env-dpiy_zy6overlaybincython.EXE)
Compiler for C supports arguments -Wno-unused-but-set-variable: YES
Compiler for C supports arguments -Wno-unused-function: YES
Compiler for C supports arguments -Wno-conversion: YES
Compiler for C supports arguments -Wno-misleading-indentation: YES
Library m found: YES
..meson.build:84:0: ERROR: Unknown compiler(s): [['ifort'], ['gfortran'], ['flang'], ['pgfortran'], ['g95']]
The following exception(s) were encountered:
Running `ifort --version` gave "[WinError 2] The system cannot find the file specified"
Running `ifort -V` gave "[WinError 2] The system cannot find the file specified"
Running `gfortran --version` gave "[WinError 2] The system cannot find the file specified"
Running `gfortran -V` gave "[WinError 2] The system cannot find the file specified"
Running `flang --version` gave "[WinError 2] The system cannot find the file specified"
Running `flang -V` gave "[WinError 2] The system cannot find the file specified"
Running `pgfortran --version` gave "[WinError 2] The system cannot find the file specified"
Running `pgfortran -V` gave "[WinError 2] The system cannot find the file specified"
Running `g95 --version` gave "[WinError 2] The system cannot find the file specified"
Running `g95 -V` gave "[WinError 2] The system cannot find the file specified"
A full log can be found at C:UsersNhoxboonAppDataLocalTemppip-install-vye30m4uscipy_7ccac87e7a8d4346b9d9d86617c5a860.mesonpy-f5huf210meson-logsmeson-log.txt
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
Encountered error while generating package metadata.
See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
-
Tried
pip install scikit-learn
andpip install pandas
but received the same error. -
Tried deleting pip and reinstalling, but no changes.
-
Tried with a different package (
pandas
), but got the same error.
1