问题
Hello community / developers,
I am currently trying to install SCIP with python and found that there is Windows Support and a pip installer based on https://github.com/SCIP-Interfaces/PySCIPOpt/blob/master/INSTALL.md.
Nevertheless I run into a problem "Cannot open include file"
Below is a list of the things I performed to get to this step.
- Download Python Anaconda 2.7 64 bit
- Install with all checkboxes as they are
- Download PyCharm Community edition
- Click 64 bit desktop link, and associate with .py checkboxes
- Open CMD > write: easy_install -U pip
- Download Visual C++ Compiler for Python 2.7
- Setup folder structure and downloaded header files
CMD > pip install pyscipopt leads to error:
C:\Users\UserName\Downloads\SCIPOPTDIR\include\scip/def.h(32) : fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory error: command 'C:\Users\UserName\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status 2
My environment variables and folder directory can be found here: http://imgur.com/a/mJRva
Help is very much appreciated, Kind regards
回答1:
The error message says your missing "stdint.h". This is because you don't have a recent Visual Studio version. You probably use the one that came with your Python installation. Try installing the latest Visual Studio to fix this issue.
You might want to look at this question: Why Microsoft Visual Studio cannot find <stdint.h>?
PySCIPOpt needs a C/C++ linker to build the Python module - although it's already precompiled on PyPI.
回答2:
Alright, I figured it out. I needed to
(1) Install Python 3.6 instead of Python 2.7 (both Anaconda) (2) Afterwards pip installation worked (3) I moved the library files in the lib folder (4) Now I can execute the examples.
Interestingly, I get an unresolved reference error although the code works fine (I assume this is a bug of Pycharm/scipy?) Link to picture: https://www.dropbox.com/s/d8pf6dkwuz9cwto/scip_python.png?dl=0
来源:https://stackoverflow.com/questions/44183891/scip-python-installation-issue-windows-with-pip