I want to use CPLEX with Python. I've added path
C:\Program Files\IBM\ILOG\CPLEX_Studio_Community129\cplex\python\3.7\x64_win64
to the system but
import cplex
it's not working.
It only works if I add the path in the program explicitly, that is:
import sys
sys.path.append('C:/Program Files/IBM/ILOG/CPLEX_Studio_Community129/cplex/python/3.7/x64_win64')
import cplex
Do you have any idea why adding the path directly to the system variables is not working?
Add the CPLEX path to PYTHONPATH
.
Windows:
My Computer > Properties > Advanced System Settings > Environment Variables
and modify it
Linux:
export PYTHONPATH="${PYTHONPATH}:/your/CPLEX/path"