opencobra/cookiecutter-memote

Required cobra version is not installed correctly

Closed this issue · 4 comments

After updating cookiecutter:

pip install cookiecutter --upgrade

and then trying to create a new memote project:

cookiecutter gh:biosustain/cookiecutter-memote

I get the following import error:

copying '/Users/clie/Desktop/Side_Projects/Memote/Ecoli_Model_collection/iJR904/iJR904.xml' -> 'iJR904.xml' Initialized empty Git repository in /Users/clie/Desktop/Side_Projects/Memote/memote-e-coli/.git/ Traceback (most recent call last): File ".git/hooks/pre-commit", line 30, in <module> from cobra.io import read_sbml_model, save_yaml_model ImportError: cannot import name save_yaml_model ERROR: Stopping generation because post_gen_project hook script didn't exit successfully Hook script failed (exit status: 1)

I couldn't fix this even by grabbing the feat/yaml-io branch:

pip install -U git+https://github.com/opencobra/cobrapy.git@feat/yaml-io#egg=cobra --upgrade

Which resulted in:

(test-memote)nnfcb-l0232:cobrapy clie$ python
Python 2.7.10 (default, Jul 14 2015, 19:46:27) 
>>> from cobra.io import save_yaml_model
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name save_yaml_model

Strange, that should have been the right path.

The cookiecutter actually doesn't install anything itself. So packages need to be available in the environment before running cookiecutter. This is usually not a problem since you would install memote (with dependencies) and then run memote new.

So if you install it first in your virtualenv:

pip install https://github.com/opencobra/cobrapy/archive/feat/yaml-io.zip

Everything should run as expected.

I guess that's where I was a bit confused. I'll give this a try and report back!

In future, everything will be solved by installing memote and its dependencies.