[Python] Issues Installing CVXPY with pip

Discussão em 'Python' iniciado por Stack, Novembro 30, 2024.

  1. Stack

    Stack Membro Participativo

    I'm trying to install cvxpy using pip install but am running into an error when preparing the metadata. My current Python version is 3.13.0, and I am on Windows 11. Note that I do not have Conda.

    Below is the error I encounter:

    C:\Users\devap>pip install cvxpy
    Collecting cvxpy
    Using cached cvxpy-1.6.0-cp313-cp313-win_amd64.whl.metadata (9.4 kB)
    Collecting osqp>=0.6.2 (from cvxpy)
    Using cached osqp-0.6.7.post3-cp313-cp313-win_amd64.whl.metadata (2.0 kB)
    Collecting clarabel>=0.5.0 (from cvxpy)
    Using cached clarabel-0.9.0-cp37-abi3-win_amd64.whl.metadata (4.8 kB)
    Collecting scs>=3.2.4.post1 (from cvxpy)
    Using cached scs-3.2.7.tar.gz (1.6 MB)
    Installing build dependencies ... done
    Getting requirements to build wheel ... done
    Installing backend dependencies ... done
    Preparing metadata (pyproject.toml) ... error
    error: subprocess-exited-with-error

    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [31 lines of output]
    + meson setup C:\Users\devap\AppData\Local\Temp\pip-install-93vr0jcn\scs_5d6757b4a018456a9eafc172d72fa671 C:\Users\devap\AppData\Local\Temp\pip-install-93vr0jcn\scs_5d6757b4a018456a9eafc172d72fa671\.mesonpy-uwreejb1 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\devap\AppData\Local\Temp\pip-install-93vr0jcn\scs_5d6757b4a018456a9eafc172d72fa671\.mesonpy-uwreejb1\meson-python-native-file.ini
    The Meson build system
    Version: 1.6.0
    Source dir: C:\Users\devap\AppData\Local\Temp\pip-install-93vr0jcn\scs_5d6757b4a018456a9eafc172d72fa671
    Build dir: C:\Users\devap\AppData\Local\Temp\pip-install-93vr0jcn\scs_5d6757b4a018456a9eafc172d72fa671\.mesonpy-uwreejb1
    Build type: native build
    WARNING: Project does not target a minimum version but uses feature introduced in '1.1': meson.options file. Use meson_options.txt instead
    Project name: scs
    Project version: undefined
    Activating VS 17.12.2
    C compiler for the host machine: cl (msvc 19.42.34435 "Microsoft (R) C/C++ Optimizing Compiler Version 19.42.34435 for x64")
    C linker for the host machine: link link 14.42.34435.0
    Host machine cpu family: x86_64
    Host machine cpu: x86_64
    Program python found: YES (C:\Users\devap\AppData\Local\Programs\Python\Python313\python.exe)
    Library openblas found: NO
    Did not find pkg-config by name 'pkg-config'
    Found pkg-config: NO
    Found CMake: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.EXE (3.29.5)
    Run-time dependency openblas found: NO (tried pkgconfig and cmake)
    Run-time dependency openblas found: NO (tried pkgconfig and cmake)
    Library blas found: NO
    Run-time dependency blas found: NO (tried pkgconfig and cmake)
    Library lapack found: NO
    Run-time dependency lapack found: NO (tried pkgconfig and cmake)
    Library cblas found: NO
    Run-time dependency cblas found: NO (tried pkgconfig and cmake)

    ..\meson.build:48:4: ERROR: Problem encountered: OpenBLAS or Netlib BLAS/CBLAS is required on all platforms except Windows, and was not found.

    A full log can be found at C:\Users\devap\AppData\Local\Temp\pip-install-93vr0jcn\scs_5d6757b4a018456a9eafc172d72fa671\.mesonpy-uwreejb1\meson-logs\meson-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.


    I tried doing pip install meson thinking that it would solve the issue with the "Project does not target a minimum version but uses feature introduced in '1.1'" error, but that didn't help. I've also installed Build Tools as per the guide here: cvxpy_guide. It seems to be erroring when trying to install SCS, but I am unsure of what to do to actually fix this issue.

    Continue reading...

Compartilhe esta Página