Próbuję zainstalować pakiet CVXPY, który ma OSQP jako zależność, ale nie udaje mi się go zainstalować. Oto dziennik:

Microsoft Windows [Version 10.0.18362.476]
(c) 2019 Microsoft Corporation. Alle Rechte vorbehalten.

C:\WINDOWS\system32>pip install osqp
Collecting osqp
  Using cached https://files.pythonhosted.org/packages/ba/17/49790ce2ce7a6b95cd250642ebc68bd723ddefdd052ee8dcc1e0dcf4ffca/osqp-0.6.1.tar.gz
Requirement already satisfied: numpy>=1.7 in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (1.17.4)
Requirement already satisfied: scipy>=0.13.2 in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (1.3.2)
Requirement already satisfied: future in c:\users\felix\appdata\local\programs\python\python38-32\lib\site-packages (from osqp) (0.18.2)
Installing collected packages: osqp
  Running setup.py install for osqp ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\felix\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"'; __file__='"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\felix\AppData\Local\Temp\pip-record-0cy159dw\install-record.txt' --single-version-externally-managed --compile
         cwd: C:\Users\felix\AppData\Local\Temp\pip-install-3lddfze1\osqp\
    Complete output (93 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-3.8
    creating build\lib.win32-3.8\osqp
    copying module\interface.py -> build\lib.win32-3.8\osqp
    copying module\utils.py -> build\lib.win32-3.8\osqp
    copying module\__init__.py -> build\lib.win32-3.8\osqp
    creating build\lib.win32-3.8\osqp\codegen
    copying module\codegen\code_generator.py -> build\lib.win32-3.8\osqp\codegen
    copying module\codegen\utils.py -> build\lib.win32-3.8\osqp\codegen
    copying module\codegen\__init__.py -> build\lib.win32-3.8\osqp\codegen
    creating build\lib.win32-3.8\osqp\tests
    copying module\tests\basic_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\codegen_matrices_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\codegen_vectors_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\dual_infeasibility_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\feasibility_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\mkl_pardiso_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\non_convex_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\polishing_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\primal_infeasibility_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\unconstrained_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\update_matrices_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\warm_start_test.py -> build\lib.win32-3.8\osqp\tests
    copying module\tests\__init__.py -> build\lib.win32-3.8\osqp\tests
    creating build\lib.win32-3.8\osqppurepy
    copying modulepurepy\interface.py -> build\lib.win32-3.8\osqppurepy
    copying modulepurepy\_osqp.py -> build\lib.win32-3.8\osqppurepy
    copying modulepurepy\__init__.py -> build\lib.win32-3.8\osqppurepy
    running egg_info
    writing osqp.egg-info\PKG-INFO
    writing dependency_links to osqp.egg-info\dependency_links.txt
    writing requirements to osqp.egg-info\requires.txt
    writing top-level names to osqp.egg-info\top_level.txt
    reading manifest file 'osqp.egg-info\SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file 'osqp.egg-info\SOURCES.txt'
    creating build\lib.win32-3.8\osqp\codegen\files_to_generate
    copying module\codegen\files_to_generate\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\files_to_generate
    copying module\codegen\files_to_generate\emosqpmodule.c -> build\lib.win32-3.8\osqp\codegen\files_to_generate
    copying module\codegen\files_to_generate\example.c -> build\lib.win32-3.8\osqp\codegen\files_to_generate
    copying module\codegen\files_to_generate\setup.py -> build\lib.win32-3.8\osqp\codegen\files_to_generate
    creating build\lib.win32-3.8\osqp\codegen\sources
    creating build\lib.win32-3.8\osqp\codegen\sources\configure
    copying module\codegen\sources\configure\osqp_configure.h.in -> build\lib.win32-3.8\osqp\codegen\sources\configure
    copying module\codegen\sources\configure\qdldl_types.h.in -> build\lib.win32-3.8\osqp\codegen\sources\configure
    creating build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\auxil.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\constants.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\error.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\glob_opts.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\kkt.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\lin_alg.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\osqp.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\proj.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\qdldl.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\qdldl_interface.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\scaling.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\types.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    copying module\codegen\sources\include\util.h -> build\lib.win32-3.8\osqp\codegen\sources\include
    creating build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\CMakeLists.txt -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\auxil.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\error.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\kkt.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\lin_alg.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\osqp.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\proj.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\qdldl.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\qdldl_interface.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\scaling.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    copying module\codegen\sources\src\util.c -> build\lib.win32-3.8\osqp\codegen\sources\src
    running build_ext
    -- Selecting Windows SDK version  to target Windows 10.0.18362.
    CMake Error at CMakeLists.txt:5 (project):
      Failed to run MSBuild command:

        MSBuild.exe

      to get the value of VCTargetsPath:

        Das System kann die angegebene Datei nicht finden



    -- Configuring incomplete, errors occurred!
    See also "C:/Users/felix/AppData/Local/Temp/pip-install-3lddfze1/osqp/osqp_sources/build/CMakeFiles/CMakeOutput.log".
    Das System kann die angegebene Datei nicht finden
    CMake Error: Generator: execution of make failed. Make command was: MSBuild.exe osqpstatic.vcxproj /p:Configuration=Release /p:Platform=Win32 /p:VisualStudioVersion=14.0 /v:m &&
    error: [Errno 2] No such file or directory: 'osqp_sources\\build\\out\\Release\\osqp.lib'
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\felix\appdata\local\programs\python\python38-32\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"'; __file__='"'"'C:\\Users\\felix\\AppData\\Local\\Temp\\pip-install-3lddfze1\\osqp\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\felix\AppData\Local\Temp\pip-record-0cy159dw\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 19.3.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Wygląda na to, że jest to problem z MSBuildTools. Zainstalowałem narzędzia do kompilacji zgodnie z instrukcjami na stronie CVXPY: https://drive .google.com/file/d/0B4GsMXCRaSSIOWpYQkstajlYZ0tPVkNQSElmTWh1dXFaYkJr/widok

To nie zadziałało. Potem znalazłem to pytanie (Wymagany jest Microsoft Visual C++ 14.0. Pobierz go za pomocą "Narzędzi do budowania Microsoft Visual C++": http://landinghub.visualst udio.com/visual-cpp-build-tools) i zmodyfikuj narzędzia do budowania instalacja odpowiednio, ale nadal nie działa. Nie mam rozwoju Pythona w sieci i chmurze, jak na zrzucie ekranu, ale i tak powinno to być opcjonalne.

Czy mógłbyś mi pomóc?

P.S .: Das System kann die angegebene Datei nicht finden z grubsza przekłada się na The system can't find the specified file

EDYCJA: Oto instalacja narzędzi do kompilacji, na wszelki wypadek:

enter image description here

1
brettljausn 19 listopad 2019, 21:17
Jeśli przejdziesz na wersję Python 3.7, masz szansę zainstalować prekompilowane koło . Możesz również wypróbować je w Pythonie 3.8: lfd.uci.edu/~gohlke/ pythonlibs/#cvxpy i lfd.uci.edu/~gohlke/ pythonlibs/#osqp
 – 
phd
19 listopad 2019, 21:41

2 odpowiedzi

Miałem do czynienia z tym samym problemem. Z linku https://www.lfd.uci.edu/~gohlke/ pythonlibs/#osqp (opublikowany przez phd), pobrał odpowiednią wersję osqp i zainstaluj go za pomocą (na przykład):

pip install osqp-0.6.1-cp38-cp38-win_amd64.whl

Następnie powinieneś być w stanie po prostu zainstalować cvxpy za pomocą

pip install cvxpy
1
ForeignVolatility 11 grudzień 2019, 06:57

Jestem jednym z programistów. Koła pip OSQP dla Pythona 3.8 są teraz online. Powinno to naprawić twój problem.

0
bstellato 8 maj 2020, 01:04