【问题标题】:Installing PySCIPOpt on Python 2.7 (Windows 10) via pip doesn't work通过 pip 在 Python 2.7 (Windows 10) 上安装 PySCIPOpt 不起作用
【发布时间】:2017-11-10 16:48:57
【问题描述】:

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

我做错了什么?

我在 64 位 Windows 10 机器上运行 Python 2.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\

它仍然不允许我发布问题,所以这里还有一些文字,也许现在它会起作用。它仍然没有。也许现在?

【问题讨论】:

    标签: python python-2.7 pip scip


    【解决方案1】:

    这里已经回答了这个问题:https://github.com/SCIP-Interfaces/PySCIPOpt/issues/102

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

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

    或类似的东西。

    【讨论】:

      【解决方案2】:

      Installation instructions 说:

      SCIPOPTDIR 需要有一个包含该库的子目录 lib。

      此外,如果您从源代码构建 PySCIPOpt,即不使用预编译的 egg 或 wheel,您还需要将所有 SCIP 头文件放入 lib 旁边的目录中(这由 make install INSTALLDIR=$ 自动完成SCIP 优化套件的 SCIPOPTDIR SHARED=true)

      所以首先你需要安装 SCIP 优化套件。

      【讨论】:

      • 嗯,我现在这样做了,但我仍然收到相同的错误消息。我只是下载了一个 Windows 的安装程序文件,这是一个“预编译的鸡蛋或轮子”,还是我必须自己做一些额外的步骤?
      猜你喜欢
      • 2018-04-18
      • 2020-02-17
      • 1970-01-01
      相关资源
      最近更新 更多