CPLEX Error 1016: Promotional version , use academic version CPLEX
Question:
I am using python with clpex, when I finished my model I run the program and it throws me the following error:
CplexSolverError: CPLEX Error 1016: Promotional version. Problem size limits exceeded.
I have the IBM Academic CPLEX installed, how can I make python recognize this and not the promotional version?
Answers:
Setting the environment variable PYTHONPATH
If you run multiple versions of CPLEX side-by-side, then use this way
of declaring the location of CPLEX and its Python API to your Python
installation by means of the environment variable PYTHONPATH.
To start using the CPLEX Python API, set the Python path environment
variable PYTHONPATH to the value of
yourCplexhome/python/VERSION/PLATFORM. Setting this environment
variable enables that version of Python to find the CPLEX modules that
it needs to run Python commands and scripts that use the CPLEX Python
API.
As suggested in the other answer, you can use the PYTHONPATH
environment variable. Another alternative is to install the academic version of the cplex
package over the top of the free “community edition”. This would work for you system Python or for a virtualenv. For example, you can do something like the following:
$ cd <COSDIR>/cplex/python/2.7/<platform>/
$ pip install .
Processing /home/rkersh/opt/CPLEX_Studio128/cplex/python/2.7/x86-64_linux
Building wheels for collected packages: cplex
Running setup.py bdist_wheel for cplex ... done
Stored in directory: /home/rkersh/.cache/pip/wheels/88/19/c6/6545d3d5ac65b18b796b44986272e17f3a8429df7b12472624
Successfully built cplex
Installing collected packages: cplex
Found existing installation: cplex 12.8.0.1
Uninstalling cplex-12.8.0.1:
Successfully uninstalled cplex-12.8.0.1
Successfully installed cplex-12.8.0.0
For the first command, COSDIR
is the location you installed CPLEX Optimization Studio and platform
is something like x86-64_linux
, x64_win64
, x86-64_osx
, etc. In the example above, you can see that COSDIR
was /home/rkersh/opt/CPLEX_Studio128
and platform
was x86-64_linux
. After doing this, you should not get CPXERR_RESTRICTED_VERSION any more.
you can go to the direction you install CPLEX. For Example, D:Cplex
After that you will see a foler name cplex, then you click on that, –> python –> choose the version of your python ( Ex: 3.6 ), then choose the folder x64_win64, you will see another file name cplex.
You copy this file into your python site packakges ^^ and then you will not be restricted
I see this error:
Processing c:program filesibmilogcplex_studio221cplexpython3.10x64_win64
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:Program FilesIBMILOGCPLEX_Studio221cplexpython3.10x64_win64setup.py", line 98, in
main()
File "C:Program FilesIBMILOGCPLEX_Studio221cplexpython3.10x64_win64setup.py", line 79, in main
check_version()
File "C:Program FilesIBMILOGCPLEX_Studio221cplexpython3.10x64_win64setup.py", line 45, in check_version
raise Exception(
Exception: this ‘cplex’ package (version 22.1.0.0) is not compatible with this version of Python: expected 3.10 but got 3.11
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
can someone help?
I am using python with clpex, when I finished my model I run the program and it throws me the following error:
CplexSolverError: CPLEX Error 1016: Promotional version. Problem size limits exceeded.
I have the IBM Academic CPLEX installed, how can I make python recognize this and not the promotional version?
Setting the environment variable PYTHONPATH
If you run multiple versions of CPLEX side-by-side, then use this way
of declaring the location of CPLEX and its Python API to your Python
installation by means of the environment variable PYTHONPATH.To start using the CPLEX Python API, set the Python path environment
variable PYTHONPATH to the value of
yourCplexhome/python/VERSION/PLATFORM. Setting this environment
variable enables that version of Python to find the CPLEX modules that
it needs to run Python commands and scripts that use the CPLEX Python
API.
As suggested in the other answer, you can use the PYTHONPATH
environment variable. Another alternative is to install the academic version of the cplex
package over the top of the free “community edition”. This would work for you system Python or for a virtualenv. For example, you can do something like the following:
$ cd <COSDIR>/cplex/python/2.7/<platform>/
$ pip install .
Processing /home/rkersh/opt/CPLEX_Studio128/cplex/python/2.7/x86-64_linux
Building wheels for collected packages: cplex
Running setup.py bdist_wheel for cplex ... done
Stored in directory: /home/rkersh/.cache/pip/wheels/88/19/c6/6545d3d5ac65b18b796b44986272e17f3a8429df7b12472624
Successfully built cplex
Installing collected packages: cplex
Found existing installation: cplex 12.8.0.1
Uninstalling cplex-12.8.0.1:
Successfully uninstalled cplex-12.8.0.1
Successfully installed cplex-12.8.0.0
For the first command, COSDIR
is the location you installed CPLEX Optimization Studio and platform
is something like x86-64_linux
, x64_win64
, x86-64_osx
, etc. In the example above, you can see that COSDIR
was /home/rkersh/opt/CPLEX_Studio128
and platform
was x86-64_linux
. After doing this, you should not get CPXERR_RESTRICTED_VERSION any more.
you can go to the direction you install CPLEX. For Example, D:Cplex
After that you will see a foler name cplex, then you click on that, –> python –> choose the version of your python ( Ex: 3.6 ), then choose the folder x64_win64, you will see another file name cplex.
You copy this file into your python site packakges ^^ and then you will not be restricted
I see this error:
Processing c:program filesibmilogcplex_studio221cplexpython3.10x64_win64
Preparing metadata (setup.py) … error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [10 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "C:Program FilesIBMILOGCPLEX_Studio221cplexpython3.10x64_win64setup.py", line 98, in
main()
File "C:Program FilesIBMILOGCPLEX_Studio221cplexpython3.10x64_win64setup.py", line 79, in main
check_version()
File "C:Program FilesIBMILOGCPLEX_Studio221cplexpython3.10x64_win64setup.py", line 45, in check_version
raise Exception(
Exception: this ‘cplex’ package (version 22.1.0.0) is not compatible with this version of Python: expected 3.10 but got 3.11
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
can someone help?