model.solve() method is not working (“CPLEX DLL not found”) for DOcplex for Python

馋奶兔 提交于 2020-01-15 06:21:20

问题


I build my mathematical model using DOcplex IBM package for Python. I am sure that the other part of the modeling is correct, however when the call to Model.solve() is executed, and I get the following error:

"CPLEX DLL not found: please provide DOcplexcloud credentials"

I have CPLEX Studio 12.6 installed on my pc, and I want to solve the problem locally not on cloud.


回答1:


It sounds like you do not have the CPLEX Python API "installed". By default, when you install CPLEX Optimization Studio (aka COS) the Python bindings are copied onto your disk, but they aren't associated with any of your local Python installations.

If you follow the instructions on the Setting up the Python API of CPLEX page, you should be able to do a local solve. In short, you can either run the setup.py script under yourCPLEXhome/python/VERSION/PLATFORM, or you can set the PYTHONPATH environment variable.




回答2:


Are you using Anaconda? I solved it by running the following in the CPLEX install directory:

python setup.py install --home <PackagesHome>\cplex

with <PackagesHome> as <user>\AppData\Local\Continuum\Anaconda2\Lib\site-packages



来源:https://stackoverflow.com/questions/41110243/model-solve-method-is-not-working-cplex-dll-not-found-for-docplex-for-pyth

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