本文介绍了通过pip在Python 2.7(Windows 10)上安装PySCIPOpt不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚尝试通过执行"pip install pyscipopt"来通过pip安装PySCIPOpt,但是却收到以下错误消息:

I just tried installing PySCIPOpt with pip by doing "pip install pyscipopt", however I get the following error message:

我在做什么错了?

我正在64位Windows 10计算机上运行Python 2.7.它不会让我发布这样的问题,因此我从下面的错误消息中删除了一些明显的部分.

I'm running Python 2.7 on a 64-bit Windows 10 machine. It wouldn't let me post the question like this, so I deleted some obvious parts from the error message below.

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\

它仍然不让我发布问题,因此这里还有一些文字,也许现在可以了.仍然没有.也许现在?

It still doesn't let me post the question, so here's some more text, maybe now it will work. It still doesn't. Maybe now?

推荐答案

此问题已在此处得到解答: https://github.com/SCIP-Interfaces/PySCIPOpt/issues/102

This question is already answered here: https://github.com/SCIP-Interfaces/PySCIPOpt/issues/102

除了安装SCIP Opt Suite之外,缺少的是设置SCIP Opt Suite的安装路径:

What was missing - apart from installing the SCIP Opt Suite - was to set the path to where the SCIP Opt Suite was installed:

set SCIPOPTDIR="C:\Program Files\SCIPOptSuite"

或类似的东西.

这篇关于通过pip在Python 2.7(Windows 10)上安装PySCIPOpt不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-05 10:28