Decision Optimization

 View Only

 Error 1016 in spite of correct PATH and valid subscription

Jules Bourgueil's profile image
Jules Bourgueil posted 05/26/26 12:48 PM

Hello,

I am working with CPLEX 22.1.2.0 (product : "IBM ILOG CPLEX Optimization Studio Developer Edition"), on a Python project using the pyomo package, in a Linux (Ubuntu) environment.

I used to use the default pyomo-CPLEX interface (ie. dialogue through shell commands and .LP file), but I wanted to try the "cplex_direct" interface (through the CPLEX python API), since it has the reputation of being faster.

My problem is that I get an 1016 error in spite of my valid subscription and the fact that my environment seems correct, after hours of troubleshooting.

Below, a minimum working example and the error that I get.

This is puzzling because :

  • cplex works fine when called from the first interface. 
  • I did install the cplex python package (version 22.1.2.0, same as my cplex)
  • it seems that my $PATH contains what it should, namely the path to my cplex executable (/opt/ibm/ILOG/CPLEX_Studio2212/cplex/bin/x86-64_linux) and the path to cpxcheckdir (/home/username/project/venv/bin
  • and indeed, the shell command which cplex yields /opt/ibm/ILOG/CPLEX_Studio2212/cplex/bin/x86-64_linux/cplex
  • I have never installed CPLEX Community Edition in this environment (unless installing the cplex python package does this ?)
  • I happen to have a very similar installation on Windows, on which the CPLEX Python API works fine, though I can't see any menaningful differences between the two, eg. in terms of environment variables

Thank you for your help !

MWE

import cplex

# Column limit for the Community Edition.
CPLEX_COLUMN_LIMIT = 1000

# Print the CPLEX version.
print("Version:", cplex.__version__)

# Create a model that will not work with the Community Edition.
cpx = cplex.Cplex()
cpx.variables.add(lb=[0.0] * (CPLEX_COLUMN_LIMIT + 1))

# Solve the model and print the solution status.
cpx.solve()
print("Status: {0} ({1})".format(cpx.solution.get_status_string(),
                                 cpx.solution.get_status()))

Output

Version: 22.1.2.0
Using size restricted mode (Could not find directory for cpxchecklic).
CPLEX Error  1016: Community Edition. Problem size limits exceeded. Purchase at http://ibm.biz/error1016..

Jules Bourgueil's profile image
Jules Bourgueil

PROBLEM SOLVED - CLOSING THREAD

The source of the problem was that I did not follow through all the steps for the installation of the python API.

I did not have the docplex package installed, installing it and running the following command solved the issue.

docplex config --upgrade Full_Path_To_This_CPLEX_Studio_Installation

The release notes of the 22.1.2 version explain what to do :

https://www.ibm.com/docs/en/icos/22.1.2?topic=rnco2-cplex-python-api-now-installed-using-pip-conda