PyCPX is a python wrapper for the IBM CPlex. While it can be downloaded via pip and easy_install, we need several steps to successfull installation.
- Mac OS X Yosemite
- Enthough Canopy (https://www.enthought.com/products/canopy/)
- Downloaded CPLEX is compressed with .cpgz. Decompress it to get .bin file first. Then chmod and execute it on terminal.
- Go to python directory (
CPLEX_Studio1261/cplex/python/2.7/x86-64_osx) and execute
python setup.py install. Make sure that your python is Canopy's one (not
/Users/[username]/Library/Enthought/Canopy_64bit/User/bin/python). See also http://www-01.ibm.com/support/knowledgecenter/SSSA5P_12.6.0/ilog.odms.studio.help/Optimization_Studio/topics/PLUGINS_ROOT/ilog.odms.cplex.help/CPLEX/GettingStarted/topics/set_up/Python_setup.html
- Just executing
pip install pycpxwill produce the following error:
In file included from pycpx/pyconcert.cpp:255: pycpx/cplex_interface.hpp:12:10: fatal error: 'ilcplex/ilocplexi.h' file not found #include <ilcplex/ilocplexi.h>
We actually need to specify the include directory that you downloaded in Step 1! The answer is:
pip install --global-option='build_ext' --global-option=-I[the path where you downloaded CPLEX]/CPLEX_Studio1261/cplex/include pycpx