[Python] error while installing scikit learn from pip

Discussão em 'Python' iniciado por Stack, Fevereiro 8, 2025.

  1. Stack

    Stack Membro Participativo

    I've been trying to install scikit learn by command pip install scikit-learn but it's showing me this error given below.

    PS:

    • Python version 3.8.5
    • pip version 22.3

    Error which is showing:

    Collecting scikit-learn
    Using cached scikit-learn-1.1.3.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
    ╰─> [96 lines of output]

    Ignoring numpy: markers 'python_version == "3.10" and platform_system == "Windows" and platform_python_implementation != "PyPy"' don't match your environment
    Collecting setuptools<60.0
    Using cached setuptools-59.8.0-py3-none-any.whl (952 kB)
    Collecting wheel
    Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
    Collecting Cython>=0.28.5
    Using cached Cython-0.29.32-py2.py3-none-any.whl (986 kB)
    Collecting oldest-supported-numpy
    Using cached oldest_supported_numpy-2022.8.16-py3-none-any.whl (3.9 kB)
    Collecting scipy>=1.3.2
    Using cached scipy-1.9.3.tar.gz (42.1 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 'error'
    error: subprocess-exited-with-error

    Getting requirements to build wheel did not run successfully.
    exit code: 1

    [64 lines of output]
    The Meson build system
    Version: 0.63.3
    Source dir: C:\Users\manju\AppData\Local\Temp\pip-install-1t0wentg\scipy_8ed1046c49a04dd98aabab84e6319b67
    Build dir: C:\Users\manju\AppData\Local\Temp\pip-install-1t0wentg\scipy_8ed1046c49a04dd98aabab84e6319b67\.mesonpy-nddxhmy3\build
    Build type: native build
    Project name: SciPy
    Project version: 1.9.3
    C compiler for the host machine: gcc (gcc 9.2.0 "gcc (MinGW.org GCC Build-2) 9.2.0")
    C linker for the host machine: gcc ld.bfd 2.32
    C++ compiler for the host machine: c++ (gcc 9.2.0 "c++ (MinGW.org GCC Build-2) 9.2.0")
    C++ linker for the host machine: c++ ld.bfd 2.32
    Host machine cpu family: x86
    Host machine cpu: x86
    Compiler for C supports arguments -Wno-unused-but-set-variable: YES
    Compiler for C supports arguments -Wno-unused-but-set-variable: YES (cached)
    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
    Compiler for C supports arguments -Wno-incompatible-pointer-types: YES
    Library m found: YES

    ..\..\meson.build:57: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:\Users\manju\AppData\Local\Temp\pip-install-1t0wentg\scipy_8ed1046c49a04dd98aabab84e6319b67\.mesonpy-nddxhmy3\build\meson-logs\meson-log.txt
    + meson setup --native-file=C:\Users\manju\AppData\Local\Temp\pip-install-1t0wentg\scipy_8ed1046c49a04dd98aabab84e6319b67\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 --prefix=c:\users\manju\appdata\local\programs\python\python38-32 C:\Users\manju\AppData\Local\Temp\pip-install-1t0wentg\scipy_8ed1046c49a04dd98aabab84e6319b67 C:\Users\manju\AppData\Local\Temp\pip-install-1t0wentg\scipy_8ed1046c49a04dd98aabab84e6319b67\.mesonpy-nddxhmy3\build
    Traceback (most recent call last):
    File "C:\Users\manju\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 351, in <module>
    main()
    File "C:\Users\manju\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 333, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
    File "C:\Users\manju\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 118, in get_requires_for_build_wheel
    return hook(config_settings)
    File "C:\Users\manju\AppData\Local\Temp\pip-build-env-8ril8k9h\overlay\Lib\site-packages\mesonpy\__init__.py", line 969, in get_requires_for_build_wheel
    with _project(config_settings) as project:
    File "c:\users\manju\appdata\local\programs\python\python38-32\lib\contextlib.py", line 113, in __enter__
    return next(self.gen)
    File "C:\Users\manju\AppData\Local\Temp\pip-build-env-8ril8k9h\overlay\Lib\site-packages\mesonpy\__init__.py", line 948, in _project
    with Project.with_temp_working_dir(
    File "c:\users\manju\appdata\local\programs\python\python38-32\lib\contextlib.py", line 113, in __enter__
    return next(self.gen)
    File "C:\Users\manju\AppData\Local\Temp\pip-build-env-8ril8k9h\overlay\Lib\site-packages\mesonpy\__init__.py", line 777, in with_temp_working_dir
    yield cls(source_dir, tmpdir, build_dir)
    File "C:\Users\manju\AppData\Local\Temp\pip-build-env-8ril8k9h\overlay\Lib\site-packages\mesonpy\__init__.py", line 682, in __init__
    self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
    File "C:\Users\manju\AppData\Local\Temp\pip-build-env-8ril8k9h\overlay\Lib\site-packages\mesonpy\__init__.py", line 713, in _configure
    self._meson(
    File "C:\Users\manju\AppData\Local\Temp\pip-build-env-8ril8k9h\overlay\Lib\site-packages\mesonpy\__init__.py", line 696, in _meson
    return self._proc('meson', *args)
    File "C:\Users\manju\AppData\Local\Temp\pip-build-env-8ril8k9h\overlay\Lib\site-packages\mesonpy\__init__.py", line 691, in _proc
    subprocess.check_call(list(args))
    File "c:\users\manju\appdata\local\programs\python\python38-32\lib\subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['meson', 'setup', '--native-file=C:\\Users\\manju\\AppData\\Local\\Temp\\pip-install-1t0wentg\\scipy_8ed1046c49a04dd98aabab84e6319b67\\.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2', '--prefix=c:\\users\\manju\\appdata\\local\\programs\\python\\python38-32', 'C:\\Users\\manju\\AppData\\Local\\Temp\\pip-install-1t0wentg\\scipy_8ed1046c49a04dd98aabab84e6319b67', 'C:\\Users\\manju\\AppData\\Local\\Temp\\pip-install-1t0wentg\\scipy_8ed1046c49a04dd98aabab84e6319b67\\.mesonpy-nddxhmy3\\build']' returned non-zero exit status 1.
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error

    Getting requirements to build wheel 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.
    [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.

    Continue reading...

Compartilhe esta Página