cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
145 stars 49 forks source link

CPLEX API of Python #132

Closed joelmhaske closed 1 year ago

joelmhaske commented 3 years ago

Hi is there simpler documentation for CPLEX available out there? I am trying to install CarveMe on a docker container and I'm struggling with the CPLEX installed as well as the Python API of it.

hariszaf commented 2 years ago

Hi. You may have a look here I guess.

AhmedElsherbini commented 2 years ago

Hi , as I had now trouble with installation (carve can not find the solver despite that python can import it and print the version of cplex). I am thinking either due to my python is 3.8 or the cplex version is 20.10. Any clue if I should keep trying to downgrade or the problem may be beyond that. (I installed before carveme by following the doc instruction $ pip ....) Just to update: it worked with me with version ILOG Cplex 20.10 and Python 3.8. However, carveme was installed using conda "conda install -c hcc carveme" not via pip strangely.

kunaljaani commented 2 years ago

Hello guys,

I could see the installed version of the cplex but still I am getting the "Solver cplex not available" error.

ubuntu@kv-metagenome:/DATA/janik/metaGEM$ python -c 'import cplex; print(cplex.version)' 20.1.0.0

Creating temporary directory /DATA/janik/metaGEM/SCRATCH/GEMs/M_bin.19.p ... Begin carving GEM ... Traceback (most recent call last): File "/home/ubuntu/.local/bin/carve", line 5, in from carveme.cli.carve import main File "/home/ubuntu/.local/lib/python3.8/site-packages/carveme/init.py", line 14, in set_default_solver(config.get('solver', 'default_solver')) File "/home/ubuntu/.local/lib/python3.8/site-packages/reframed/solvers/init.py", line 60, in set_default_solver raise RuntimeError(f"Solver {solvername} not available.") RuntimeError: Solver cplex not available.

UPDATE

It finally worked! After installing an academic version of CPLEX followed the steps for CPLEX python API.

ubuntu@#####:$ cd /opt/ibm/ILOG/CPLEX_Studio201/cplex/python/3.8/x86-64_linux/ ubuntu@#####:$ python setup.py install ubuntu@#####:$ python setup.py install --home /home/ubuntu/.local/lib/python3.8/site-packages/cplex ubuntu@#####:$ export PYTHONPATH=/opt/ibm/ILOG/CPLEX_Studio201/cplex/python/3.8/x86-64_linux

Thanks a lot. Kunal