无法使用python 3.8安装cvxpy

时间:2020-02-18 09:18:27

标签: python pip cvxpy

我尝试为python安装cvxpy(https://www.cvxpy.org/install/)。我在所有项目中都使用Python 3.8,不喜欢在使用3.7的虚拟环境中使用。有人有在python 3.8上使用cvxpy的修复程序(我正在使用Windows)吗?

谢谢!

ERROR: Command errored out with exit status 1:
ommand: 'AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'AppData\\Local\\Temp\\pip-install-kehvj2di\\osqp\\setup.py'"'"'; __file__='"'"'AppData\\Local\\Temp\\pip-install-kehvj2di\\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 'AppData\Local\Temp\pip-record-1u4al7gt\install-record.txt' --single-version-externally-managed --compile
cwd: AppData\Local\Temp\pip-install-kehvj2di\osqp\

-- 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:

        The system cannot find the file specified



    -- Configuring incomplete, errors occurred!
    See also "AppData/Local/Temp/pip-install-kehvj2di/osqp/osqp_sources/build/CMakeFiles/CMakeOutput.log".
    The system cannot find the file specified
    CMake Error: Generator: execution of make failed. Make command was: MSBuild.exe osqpstatic.vcxproj /p:Configuration=Release /p:Platform=x64 /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: 'AppData\Local\Programs\Python\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'Local\\Temp\\pip-install-kehvj2di\\osqp\\setup.py'"'"'; __file__='"'"'AppData\\Local\\Temp\\pip-install-kehvj2di\\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 'AppData\Local\Temp\pip-record-1u4al7gt\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 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

1 个答案:

答案 0 :(得分:0)

您的问题似乎不是Python版本,但缺少构建工具。安装Microsoft Visual Build Tools并确保它们位于PATH上(以便conda可以执行MSBuild.exe)。

cvxpy(在pptx中)构建工具installation instructions