问题
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