Originally posted by: naveendivakaran
Thank you Alex.
These answers help with what i should use for interacting with cplex through python. My question was more general as to what would be a good methodology of separating model, data, algorithm and reporting, with object oriented programming. Maybe I should not have cross-posted this question. My bad. I get a few directions from answers in this posting: https://or.stackexchange.com/questions/3103/implementing-solvers-with-object-oriented-programming.
I did not know about the existence of doopl. i was aware of docplex. Is doopl newer than docplex?
I tried to use doopl, but I get the following error while trying to import ..
Is it because it does not work very well with anaconda. I added it to path to bin to the environment variables too.
from doopl.factory import *
Traceback (most recent call last):
File "//anaconda/lib/python3.5/site-packages/doopl/opl.py", line 8, in <module>
from doopl.internal.opl1290.opl import *
File "//anaconda/lib/python3.5/site-packages/doopl/internal/opl1290/opl.py", line 7, in <module>
from . import _opl
ImportError: dlopen(//anaconda/lib/python3.5/site-packages/doopl/internal/opl1290/_opl.so, 2): Library not loaded: libopl1290.dylib
Referenced from: //anaconda/lib/python3.5/site-packages/doopl/internal/opl1290/_opl.so
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "//anaconda/lib/python3.5/site-packages/doopl/opl.py", line 11, in <module>
from doopl.internal.opl1280.opl import *
File "//anaconda/lib/python3.5/site-packages/doopl/internal/opl1280/opl.py", line 7, in <module>
from . import _opl
ImportError: dlopen(//anaconda/lib/python3.5/site-packages/doopl/internal/opl1280/_opl.so, 2): Library not loaded: libopl1280.dylib
Referenced from: //anaconda/lib/python3.5/site-packages/doopl/internal/opl1280/_opl.so
Reason: image not found
Traceback (most recent call last):
File "//anaconda/lib/python3.5/site-packages/doopl/opl.py", line 8, in <module>
from doopl.internal.opl1290.opl import *
File "//anaconda/lib/python3.5/site-packages/doopl/internal/opl1290/opl.py", line 7, in <module>
from . import _opl
ImportError: dlopen(//anaconda/lib/python3.5/site-packages/doopl/internal/opl1290/_opl.so, 2): Library not loaded: libopl1290.dylib
Referenced from: //anaconda/lib/python3.5/site-packages/doopl/internal/opl1290/_opl.so
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "//anaconda/lib/python3.5/site-packages/doopl/opl.py", line 11, in <module>
from doopl.internal.opl1280.opl import *
File "//anaconda/lib/python3.5/site-packages/doopl/internal/opl1280/opl.py", line 7, in <module>
from . import _opl
ImportError: dlopen(//anaconda/lib/python3.5/site-packages/doopl/internal/opl1280/_opl.so, 2): Library not loaded: libopl1280.dylib
Referenced from: //anaconda/lib/python3.5/site-packages/doopl/internal/opl1280/_opl.so
Reason: image not found
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/python3.5/site-packages/doopl/factory.py", line 7, in <module>
from doopl.opl import *
File "//anaconda/lib/python3.5/site-packages/doopl/opl.py", line 15, in <module>
raise ImportError('Could not import OPL wrappers. Make sure than OPL bin directory is in the PATH')
ImportError: Could not import OPL wrappers. Make sure than OPL bin directory is in the PATH.
#CPLEXOptimizers#DecisionOptimization