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.
Environment:
Step 1: installing CPLEX
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 /usr/bin/python
but /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.htmlStep 2: installing PyCPX with linking CPLEX
pip install pycpx
will 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
See also http://stackoverflow.com/questions/18783390/python-pip-specify-a-library-directory-and-an-include-directory
Recommended Posts