Decision Optimization

 View Only

 Python API - Academic License

Bastien Cajot's profile image
Bastien Cajot posted Sat May 10, 2025 06:03 AM

Hi everyone,

My name is Bastien, and I’m a Master’s student in Business Engineering and Computer Science at the University of Liège.

As part of my thesis, I’m working on a Vehicle Routing Problem (VRP) that integrates robust optimization and decreasing rewards. To model and solve this, I’m using CPLEX and DOcplex within a Jupyter Notebook in an Anaconda environment.

However, I’ve run into an issue: I'm unable to go beyond 1,000 constraints, which is a problem since I’m still in the early stages of defining the model. From what I understand, this limit is imposed by the Community Edition of CPLEX, which was installed via:
pip install cplex
pip install docplex

I’ve since obtained an Academic license through the IBM Academic Initiative. However, I haven’t found a way to link the full licensed version to my Anaconda environment. I tried uninstalling the pip-installed version and instead running:
cd "C:\Program Files\IBM\ILOG\CPLEX_Studio2212\python\cplex"
pip install
---
set CPLEX_STUDIO_DIR2212="C:\Program Files\IBM\ILOG\CPLEX_Studio2212"
set PATH=%CPLEX_STUDIO_DIR2212%\cplex\bin\x64_win64;%PATH%
--- 

Unfortunately, there is no  \python directory in version 22.1.2, so the above path doesn’t work.

Does anyone know how to correctly install and link the licensed Academic version of CPLEX to an Anaconda environment when the python folder is missing in the installation directory?

Any help would be greatly appreciated!

Thanks,
Bastien

PhR's profile image
PhR

Here are the steps to install the Python interface to CPLEX Optimization Studio in 22.1.2: 

  1. install regular CPLEX Optimization Studio say in <COSDIR>

  2. install CP Optimizer Python interface directly from PyPI or from Anaconda, using the commands
      pip install cplex (conda install cplex for Anaconda)
      pip install docplex (conda install docplex for Anaconda)
    The first command installs the Community Edition CPLEX and CP Optimizer runtimes as well as a low-level Python interface to CPLEX. The second installs the higher-level "docplex" Python package which includes CPLEX and CP Optimizer modelling and solving support. The Community Edition runtimes which come as standard are limited in the size of optimization problems that they can solve.
    You should try to run an example to check the installation of the Community Edition edition at this stage before proceeding to the upgrade. Note that at this stage the size of the problems you can solve is limited.

  3. To upgrade the Community Edition runtimes and remove size limitations, use the command "docplex" which was installed when you installed the "docplex" module with pip or conda. Running:
      docplex config --upgrade <COSDIR>
    will upgrade the CPLEX and CP Optimizer Python runtimes from the Community Edition version to a size-unlimited version.

Regards

Philippe