

Hello Sana, Thanks for your explanations, I now understand better. Replace $PYTHON with the directory you installed the bindings to in Step 4. Subject: Model problems with docplex and cplex on python.
#Install cplex python install
'Install via conda install -c ibmdecisionoptimization cplex ' 'or pip install cplex') import cplex m cplex.Cplex() out m.setlogstream(solverlogfile) if solveroptions. With PythonĪny jobs you want to submit using the Python interface must first load the python3 module, and then activate your virtual environment. CPLEX parameters can be set by using their name in the python interface, excluding the leading cplex.parameters., as key (e.g. Compile against these and your resulting executable should run fine in jobs without any extra requirements. Includes are in $CPLEX/cplex/include and static librarys are in $CPLEX/cplex/lib/x86-64_linux/static_pic. Since you have activated a python virtual environment, python already knows where to install the bindings. Step 4 - Install Python bindingsĬd $CPLEX/cplex/python/python3.4/x86-64_linux (replace 3.4 with 2.6 if you want the 2.6 bindings), then run python3 setup.py install. To save some space, I remove the documentation folder by running cd $CPLEX/ rm -r doc. Step 3.5 - Remove documentation (optional)Ĭplex takes up close to 2GB of drive space, and that is your limit on NCI.

with your own home directory fully written out).Įnsure the directory has been entered correctly, then continue with installation.
#Install cplex python full
Note that you cannot use the ~ shortcut here, enter the full path (i.e.
#Install cplex python license
After accepting the license agreement, the installer will ask you for an installation directory. Select your preferred locale, accept the warning and license agreement. Run sh cplex_ (you might need to change the version numbers or path). That $PYTHON is the place you decided to install the python bindings Step 2 - Activate the Python environmentĬd $PYTHON and then run source bin/activate. If you have multiple versions of python installed, say 2.7 and 3.4, you can specify the version of python to use by running pyvenv-3.4 $PYTHON or similar.

Run module load python3 Step 1 - Set up Python virtual environment Step 0.5 - Load python modules if on raijin From here on, I will refer to the cplex directory as $CPLEX and the python directory as $PYTHON. Note that ~ is a common unix shortcut for your homeĭirectory, so for me I will install cplex into /home/595/wep595/opt/ibm/ILOG/CPLEX_Studio1263. I suggest installing cplex into ~/opt/ibm/ILOG/CPLEX_Studio1263 and the python bindings into ~/cplex. Ied to move to your home directory, and then run pwd to see your home directory. First you want to find out what your home directory is, so run cd with no directory specif Use pip to install the modeling library: > pip install docplex pip is the standard tool that is used to install Python packages and is included in Python 2.7.9 (and later), Python 3.6 (and later), and Python 3.7 (and later). You'll be installing everything into your home directory, so you might want to keep it organised. The IBM Decision Optimization CPLEX Modeling for Python (DOcplex) library can be installed via pip from PyPI. Installing CPLEX Step 0 - Decide where you want things
