psalvy / bigg-docker

0 stars 1 forks source link

ImportError: cannot import name Formula #1

Open matthiaskoenig opened 5 years ago

matthiaskoenig commented 5 years ago

I just tried to follow the instructions. The bigg-docker_web_1 exited with code 1. The

docker-compose up

results in

web_1  | WARNING: errors ignored on restore: 194
web_1  | SERVING YOLOSWAGZ RIGHT NOW
web_1  | Traceback (most recent call last):
web_1  |   File "/usr/local/lib/python2.7/runpy.py", line 174, in _run_module_as_main
web_1  |     "__main__", fname, loader, pkg_name)
web_1  |   File "/usr/local/lib/python2.7/runpy.py", line 72, in _run_code
web_1  |     exec code in run_globals
web_1  |   File "/src/git/bigg_models/bigg_models/server.py", line 4, in <module>
web_1  |     from bigg_models import queries, __api_version__ as api_v
web_1  |   File "bigg_models/queries.py", line 6, in <module>
web_1  |     from ome.loading.model_loading import parse
web_1  |   File "/src/git/cobradb/ome/loading/__init__.py", line 4, in <module>
web_1  |     from model_loading import load_model
web_1  |   File "/src/git/cobradb/ome/loading/model_loading.py", line 9, in <module>
web_1  |     from ome.loading import parse
web_1  |   File "/src/git/cobradb/ome/loading/parse.py", line 10, in <module>
web_1  |     from cobra.core import Formula
web_1  | ImportError: cannot import name Formula
psalvy commented 5 years ago

Good day Matthias,

I did not have time to look into this issue yet, but I have a gut feeling, and I though I could share it with you in case it solves your issue. I see in that in web/requirements.txt the specified cobra version is cobra>=0.4.0 Can you try changing this line to cobra==0.4.0 Or maybe later versions like 0.6. If I recall correctly, Formula is not imported from cobra.core anymore but from cobra.core.formula. My hunch is that reverting to a previous version might solve this issue.

Let me know how it goes :)

Cheers, Pierre