6
$\begingroup$

Python does not identify the academic version of CPLEX.

I am using Linux, Ubuntu. I have Python 3.6. I installed CPLEX studio 12.9 (academic version installed via the file cplex_studio129.linux-x86-64.bin that I downloaded from ibm.biz/CPLEXonAI) installed at \opt directory.

I also installed the file setup.py that is available in /opt/ibm/ILOG/CPLEX_Studio129/cplex/python/3.7/x86-64_linux, using the terminal.

With all those, when I run my code in PyCharm, or in Terminal, I get: CPLEX Error 1016: Community Edition. Problem size limits exceeded. Purchase at https://ibm.co/2s0wqSa.

I found some similar questions, with helps suggesting to do correct the PYTHONPATH, but I could not understand what to do actually.

$\endgroup$
  • 1
    $\begingroup$ There are some related questions about that. For instance, Would you see this link? $\endgroup$ – A.Omidi Nov 26 '19 at 10:39
  • 1
    $\begingroup$ Try removing the Community Edition from your computer. $\endgroup$ – Mark L. Stone Nov 26 '19 at 13:01
  • $\begingroup$ @MarkL.Stone Thank you very much for the great help. It was as simple as that! I post what I did for further reference. $\endgroup$ – Mostafa Nov 29 '19 at 5:46
4
$\begingroup$

I've had this problem in the past with CPLEX Error 1016, though in Windows, and this is how I resolved it (assuming you have the correct installation of CPLEX on your machine and the appropriate python packages):

  • From the command prompt, go to the directory where CPLEX is installed (e.g. "C:\Program Files\IBM\ILOG\CPLEX_Studio129\python")
  • Run python setup.py install
  • Restart your system!

After doing these steps, when I navigate to the system path, I could see the path for CPLEX. You can check that on your machine too by doing the following (again, this is for windows but hopefully the idea is the same):

  • Go to Control panel > Edit the system environment variables > Advanced > Environment Variables...>
  • In the "User variables for your_name", you'll see "Path". Make sure you see the path for the cplex.exe and python version you have installed the setup.py for. For example:

    "C:\Program Files\IBM\ILOG\CPLEX_Studio129\cplex\python\3.6\x64_win64" and

    "C:\Program Files\IBM\ILOG\CPLEX_Studio129\cplex\bin\x64_win64\cplex.exe"

$\endgroup$
3
$\begingroup$

Thanks to all for the great suggestions. The thing that should be done is to install CPLEX setup.py in the site-packages of the python. But it is not enough. Actually, what worked was the suggestion to remove the community version first (as MarkL.Stone suggested).

So, what I suggest for further reference is to do something like:


1- Remove your CPLEX community version.

It can be in a folder like the following: /home/<<your-computer-name>>/.local/lib/python3.6/site-packages/cplex/

For this, you can open terminal and run:

rm -r /home/<<your-computer-name>>/.local/lib/python3.6/site-packages/cplex/


2- Install the CPLEX setup.py file.

For this, go to the folder that CPLEX is installed, and go to the following subfolder: opt/ibm/ILOG/CPLEX_Studio129/python (opt is where my CPLEX is installed). Then open the terminal and run:

sudo python setup.py install --home home/<<your-computer-name>>/.local/lib/python3.6/site-packages/cplex


Note that you should adjust the part <<your-computer-name>> in the commands in both steps.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.