model.solve() method is not working (“CPLEX DLL no

2019-07-14 04: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.

2条回答
放荡不羁爱自由
2楼-- · 2019-07-14 04:54

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.

查看更多
来,给爷笑一个
3楼-- · 2019-07-14 05:04

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

查看更多
登录 后发表回答