CPLEX and Python 3.7

好久不见. 提交于 2021-01-28 08:22:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!