我刚刚尝试通过执行"pip install pyscipopt“来使用pip安装PySCIPOpt,但是我得到了以下错误消息:
我做错了什么?
我在64位的Windows10机器上运行Python2.7。
Collecting pyscipopt
Using cached PySCIPOpt-1.2.0.tar.gz
Building wheels for collected packages: pyscipopt
Running setup.py bdist_wheel for pyscipopt ... error
Complete output from command C:\Python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\daniel\\appdata\\local\\temp\\pip-build-kejfxp\\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\daniel\appdata\local\temp\tmpaj_ydopip-wheel- --python-tag cp27:
scipoptir:
includedir: c:\users\daniel\appdata\local\temp\pip-build-kejfxp\pyscipopt\include
libdir: c:\users\daniel\appdata\local\temp\pip-build-kejfxp\pyscipopt\lib
running bdist_wheel
creating build\temp.win32-2.7\Release\src\pyscipopt
C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\daniel\appdata\local\temp\pip-build-kejfxp\pyscipopt\include -IC:\Python27\include -IC:\Python27\PC /Tcsrc\pyscipopt\scip.c /Fobuild\temp.win32-2.7\Release\src\pyscipopt\scip.obj
scip.c
src\pyscipopt\scip.c(507) : fatal error C1083: Cannot open include file: 'scip/scip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
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
Complete output from command C:\Python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\daniel\\appdata\\local\\temp\\pip-build-kejfxp\\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\daniel\appdata\local\temp\pip-zqfl67-record\install-record.txt --single-version-externally-managed --compile:
scipoptir:
includedir: c:\users\daniel\appdata\local\temp\pip-build-kejfxp\pyscipopt\include
libdir: c:\users\daniel\appdata\local\temp\pip-build-kejfxp\pyscipopt\lib
running install
creating build\temp.win32-2.7\Release\src\pyscipopt
C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Ic:\users\daniel\appdata\local\temp\pip-build-kejfxp\pyscipopt\include -IC:\Python27\include -IC:\Python27\PC /Tcsrc\pyscipopt\scip.c /Fobuild\temp.win32-2.7\Release\src\pyscipopt\scip.obj
scip.c
src\pyscipopt\scip.c(507) : fatal error C1083: Cannot open include file: 'scip/scip.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Common Files\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\daniel\\appdata\\local\\temp\\pip-build-kejfxp\\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\daniel\appdata\local\temp\pip-zqfl67-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\daniel\appdata\local\temp\pip-build-kejfxp\pyscipopt\现在也不是。也许是现在?
发布于 2017-11-12 23:50:24
这个问题已经在这里得到了回答:https://github.com/SCIP-Interfaces/PySCIPOpt/issues/102
除了安装SCIP Opt Suite之外,还缺少设置安装SCIP Opt Suite的路径:
set SCIPOPTDIR="C:\Program Files\SCIPOptSuite"或者类似的东西。
发布于 2017-11-11 01:09:37
SCIPOPTDIR需要有一个包含库的子目录库。
此外,如果您正在从源代码构建PySCIPOpt,即不使用预编译蛋或轮子,您还需要将所有SCIP头文件放在lib旁边的包含目录中(这是由SCIP优化套件的make install INSTALLDIR=$SCIPOPTDIR SHARED=true自动完成的)
因此,首先您需要安装SCIP优化套件。
https://stackoverflow.com/questions/47227583
复制相似问题