问题
I'm trying to use cplex with python version 3.7.3. CPLEX has a setup.py for version 3.7, but when I try to use it I still get the error "CPLEX 12.9.0.0 is not compatible with this version of Python". Is there a workaround for this or do I need to downgrade to Python 3.6?
回答1:
Let's assume the Python 3.7 executable is located at C:\Python37\python.exe
and CPLEX 12.9 is installed at C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129
. Then, to install the CPLEX Python API, you would do something like the following:
cd "C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\python\3.7\x64_win64\"
C:\Python37\python.exe setup.py install
The installation instructions for the CPLEX Python API can be found here.
回答2:
Yes,
To my knowledge for the optimization solvers CPLEX and DOCPLEX you need to downgrade to Python 3.6 currently.
回答3:
I myself had to downgrade to Python 3.6 because I had the same problem but that was because Python 3.7 is 32-bit and the CPLEX API requires 64-bit (I can't tell you why, but that's just what I learned). Once you install Python 3.6 64-bit then you can download the CPLEX and DOPLEX packages so easily you'll hate that you didn't do it in the first place.
来源:https://stackoverflow.com/questions/56634674/cplex-and-python-3-7