gpt4 book ai didi

python - 如何修复 "Failed building wheel for pyscipopt"?

转载 作者:行者123 更新时间:2023-12-03 08:53:01 25 4
gpt4 key购买 nike

我正在尝试安装 Pyscipopt 来做作业。学校网站上有安装指南,问题是它不适用于我的笔记本电脑。我必须在 Anaconda Prompt 中编写“pip install pyscipopt”,但收到错误“pyscipopt 构建轮失败”。我不知道这意味着什么或如何解决这个问题,有人可以帮助我吗?

(base) C:\Users\claire>pip install pyscipopt
Collecting pyscipopt
Using cached https://files.pythonhosted.org/packages/a7/47/e3d5fcc37138c0eb9695d7c26e22b999c1274b06606db183c2aa36f98e5a/PySCIPOpt-2.2.0.tar.gz
Building wheels for collected packages: pyscipopt
Building wheel for pyscipopt (setup.py) ... error
ERROR: Complete output from command 'C:\Users\claire\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\claire\\AppData\\Local\\Temp\\pip-install-zja79xrm\\pyscipopt\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\claire\AppData\Local\Temp\pip-wheel-jnmor4q4' --python-tag cp37:
ERROR: Using include path <C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\src>.
Using SCIP library <scip> at <C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\lib>.
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\Multidict.py -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\__init__.py -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\scip.pyx -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\scip.pxd -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\benders.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\benderscut.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\branchrule.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\conshdlr.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\event.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\expr.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\heuristic.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\lp.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\presol.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\pricer.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\propagator.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\relax.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\sepa.pxi -> build\lib.win-amd64-3.7\pyscipopt
running build_ext
building 'pyscipopt.scip' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\pyscipopt
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\src -IC:\Users\claire\Anaconda3\include -IC:\Users\claire\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc\pyscipopt\scip.c /Fobuild\temp.win-amd64-3.7\Release\src\pyscipopt\scip.obj
scip.c
src\pyscipopt\scip.c(621): fatal error C1083: Cannot open include file: 'scip/scip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for pyscipopt
Running setup.py clean for pyscipopt
Failed to build pyscipopt
Installing collected packages: pyscipopt
Running setup.py install for pyscipopt ... error
ERROR: Complete output from command 'C:\Users\claire\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\claire\\AppData\\Local\\Temp\\pip-install-zja79xrm\\pyscipopt\\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\claire\AppData\Local\Temp\pip-record-aw3wx8lo\install-record.txt' --single-version-externally-managed --compile:
ERROR: Using include path <C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\src>.
Using SCIP library <scip> at <C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\lib>.
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\Multidict.py -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\__init__.py -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\scip.pyx -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\scip.pxd -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\benders.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\benderscut.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\branchrule.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\conshdlr.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\event.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\expr.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\heuristic.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\lp.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\presol.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\pricer.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\propagator.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\relax.pxi -> build\lib.win-amd64-3.7\pyscipopt
copying src\pyscipopt\sepa.pxi -> build\lib.win-amd64-3.7\pyscipopt
running build_ext
building 'pyscipopt.scip' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\pyscipopt
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -IC:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\src -IC:\Users\claire\Anaconda3\include -IC:\Users\claire\Anaconda3\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\ATLMFC\include" "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\cppwinrt" /Tcsrc\pyscipopt\scip.c /Fobuild\temp.win-amd64-3.7\Release\src\pyscipopt\scip.obj
scip.c
src\pyscipopt\scip.c(621): fatal error C1083: Cannot open include file: 'scip/scip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command "'C:\Users\claire\Anaconda3\python.exe' -u -c 'import setuptools, tokenize;__file__='"'"'C:\\Users\\claire\\AppData\\Local\\Temp\\pip-install-zja79xrm\\pyscipopt\\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\claire\AppData\Local\Temp\pip-record-aw3wx8lo\install-record.txt' --single-version-externally-managed --compile" failed with error code 1 in C:\Users\claire\AppData\Local\Temp\pip-install-zja79xrm\pyscipopt\

最佳答案

这是实际的错误:

 Cannot open include file: 'scip/scip.h': No such file or directory

要解决此问题,请执行概述的安装说明 here 。最重要的是,您需要先安装 SCIP Optimization Suite。您可以获取 Windows 安装程序 here 。安装后,您需要设置一个环境变量,告诉 PySCIPOpt 安装程序在哪里可以找到用于链接的 SCIP 库:

 set SCIPOPTDIR="C:\Program Files\SCIPOptSuite-6.0.2"
pip install pyscipopt

(假设您使用 SCIPOptSuite 的默认安装路径)

关于python - 如何修复 "Failed building wheel for pyscipopt"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57783308/

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