gpt4 book ai didi

python - 安装 OSQP 包时遇到问题

转载 作者:太空宇宙 更新时间:2023-11-03 20:06:31 26 4
gpt4 key购买 nike

我正在尝试安装 CVXPY 软件包,该软件包具有 OSQP 作为依赖项,但安装失败了。这是日志:

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.

这似乎是 MSBuildTools 的问题。我已经按照 CVXPY 网页上的说明安装了构建工具:https://drive.google.com/file/d/0B4GsMXCRaSSIOWpYQkstajlYZ0tPVkNQSElmTWh1dXFaYkJr/view

那没用。然后我发现了这个问题( Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualst udio.com/visual-cpp-build-tools )并相应地修改了构建工具安装,但它仍然不起作用。我没有像截图中那样在Web和云下进行Python开发,但这应该是可选的。

你能帮我一下吗?

P.S.: Das System kann die angegebene Datei nicht finden 大致翻译为系统找不到指定的文件

编辑:这是构建工具的安装,以防万一:

enter image description here

最佳答案

我也遇到了同样的问题。来自链接https://www.lfd.uci.edu/~gohlke/pythonlibs/#osqp (由 phd 发布),下载相应版本的 osqp 并使用(例如)安装:

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

然后,您应该能够简单地使用cvxpy安装

pip install cvxpy

关于python - 安装 OSQP 包时遇到问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58940455/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com