Hello,
I am getting a similar error, but with Linux (Ubuntu 18.04.5 LTS x86_64), and directly from python.
When trying to call cplex from a python package (micom), I get the error:
CPLEX is available but could not load with error:
Traceback (most recent call last):
File "/home/username/.local/lib/python3.6/site-packages/optlang/__init__.py", line 43, in <module>
from optlang import cplex_interface
File "/home/vusername/.local/lib/python3.6/site-packages/optlang/cplex_interface.py", line 32, in <module>
from cplex.exceptions import CplexSolverError
ModuleNotFoundError: No module named 'cplex.exceptions'
I noticed that python /opt/ibm/ILOG/CPLEX_Studio201/python/setup.py install
failed to install enum, returning: AttributeError: module 'enum' has no attribute 'IntFlag'
I found some stackoverflow topics about it, but none seemed to work here.
Any clue on how can we solve this?
Thanks!!!
------------------------------
Vanessa Marcelino
------------------------------
Original Message:
Sent: Wed February 03, 2021 04:48 AM
From: Viu Long Kong
Subject: ModuleNotFoundError: No module named 'cplex.exceptions'
Hello,
So you installed the wrappers using `python setup.py install etc.. ` in a termnail.
Then you are running jupyter, and in a notebook, you cannot import cplex.exceptions.
Are you sure that your jupyter is using the same python environment than the one you installed the wrappers in ?
To be sure, you probably want to run the installation inside a jupyter noteook.
Create a new notebook, with one cell (replace with your actual CPLEX Studio path), with that two lines:
%cd "C:\Program Files\IBM\ILOG\CPLEX_Studio201\cplex\python\3.7\x64_win64"
!pip install .
Then restart your kernel.
Best regards
------------------------------
Viu Long Kong
------------------------------
#DecisionOptimization