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
votes
What operating system are you on? Do you have multiple versions of Python on your system? You have to run setup.py with the correct version of Python. Show us what you get if you just run python and drop into the interactive prompt (i.e., it will show us the version information).
- rkersh
OS = windows. I have 3.7.3 and 3.6.8. I ran setup using 3.7. Now I running setup using 3.6. "C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\python\2.7\x64_win64\cplex_internal_pycplex_platform.py". I get this error. I assume it's trying to use 2.7,but I don't know how to specify 3.6 because I already ran setup for 3.6 @rkersh
- Austin Johnson
3 Answers
3
votes
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.
1
votes
0
votes
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.