cdanielmachado / carveme

CarveMe: genome-scale metabolic model reconstruction
Other
147 stars 50 forks source link

TypeError: not a list, when run carve #60

Closed PandengWang closed 4 years ago

PandengWang commented 4 years ago

Thanks for providing this useful tool! After I installed carveme following the instructions, I ran carve --dna Bin.10.gene.fna -o bin10.xml. Then, I got an error as below:

Traceback (most recent call last): File "/mdata/lijl/software/miniconda3/envs/carve/bin/carve", line 364, in ref_score=args.reference_score File "/mdata/lijl/software/miniconda3/envs/carve/bin/carve", line 198, in main debug_output=debug_output) File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/carveme/reconstruction/carving.py", line 236, in carve_model ref_reactions=ref_reactions, ref_score=ref_score, debug_output=debug_output) File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/carveme/reconstruction/carving.py", line 123, in minmax_reduction solver.update() File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/framed/solvers/cplex_interface.py", line 206, in update self.add_variables(var_ids, lbs, ubs, vartypes) File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/framed/solvers/cplex_interface.py", line 105, in add_variables self.problem.variables.add(names=var_ids, lb=lbs, ub=ubs, types=vartypes) File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/cplex/_internal/_subinterfaces.py", line 456, in add obj, lb, ub, types, names, columns) File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/cplex/_internal/_baseinterface.py", line 41, in _add_iter addfun(*args, **kwargs) File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/cplex/_internal/_subinterfaces.py", line 378, in _add types, names) File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/cplex/_internal/_procedural.py", line 967, in newcols xctype, colname) File "/mdata/lijl/software/miniconda3/envs/carve/lib/python3.6/site-packages/cplex/_internal/_pycplex.py", line 1785, in CPXXnewcols return _pycplex_platform.CPXXnewcols(env, lp, ccnt, py_obj, py_lb, py_ub, xctype, colname) TypeError: not a list

My python packages' version are as belows:

$ pip list Package Version
carveme 1.2.2
certifi 2019.11.28
chardet 3.0.4
cplex 12.10.0.0
cycler 0.10.0
docloud 1.0.375
docplex 2.11.176
enum34 1.1.6
framed 0.5.1
future 0.18.2
idna 2.8
kiwisolver 1.1.0
matplotlib 3.1.2
mpmath 1.1.0
numpy 1.17.4
pandas 0.25.3
pip 19.3.1
pyparsing 2.4.5
python-dateutil 2.8.1
python-libsbml 5.18.0
pytz 2019.3
requests 2.22.0
scipy 1.4.0
setuptools 42.0.2.post20191201 six 1.13.0
sympy 1.5
urllib3 1.25.7
wheel 0.33.6

Could you help me to solve this problem?

Thanks so much. Pandeng

cdanielmachado commented 4 years ago

Hi @PandengWang,

You have a new version of cplex (12.10) that I have not tried yet. I suspect that might be the problem. Would it be possible for you to downgrade to cplex 12.8 ?

Best regards, Daniel

PandengWang commented 4 years ago

Hi @cdanielmachado , After I downgraded cplex to 12.8, it worked! Thanks so much!

cdanielmachado commented 4 years ago

By the way, this issue is now fixed here and will be integrated into a future release.

franciscozorrilla commented 4 years ago

I get the TypeError: not a list in my python 3.6 environment which has CPLEX 12.10 (even after updating the reframed/solvers/cplex_solver.py file), but everything seems to work fine in my python 2.7 env with CPLEX 12.9.