簡體   English   中英

通過pip在Python 2.7(Windows 10)上安裝PySCIPOpt不起作用

[英]Installing PySCIPOpt on Python 2.7 (Windows 10) via pip doesn't work

我只是嘗試通過執行“ 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\

它仍然不讓我發布問題,因此這里還有一些文字,也許現在可以了。 仍然沒有。 也許現在?

這個問題已經在這里得到回答: https : //github.com/SCIP-Interfaces/PySCIPOpt/issues/102

除了安裝SCIP Opt Suite之外,缺少的是設置SCIP Opt Suite的安裝路徑:

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

或類似的東西。

安裝說明說:

SCIPOPTDIR需要具有包含該庫的子目錄lib。

另外,如果要從源代碼構建PySCIPOpt,即不使用預編譯的egg或wheel,則還需要將所有SCIP頭文件放入lib旁邊的目錄中(此操作由make install INSTALLDIR = $ SCIPOPTDIR SHARED =自動完成。適用於SCIP優化套件)

因此,首先您需要安裝SCIP Optimization Suite。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM