ImportError: libSBML required for fbc < 2

531 views
Skip to first unread message

Bhushan Dhamale

unread,
May 18, 2017, 1:53:47 AM5/18/17
to cobra pie
I have been learning COBRApy from the tutorials in its documentation. In tutorial #3 'Reading and writing models', I get an import error for In [4] as ImportError: libSBML required for fbc < 2.
I am attaching a screenshot of my python script and output for the same for reference.

What is going wrong? How do I fix it?
ImportError.png

Moritz Beber

unread,
May 18, 2017, 4:26:11 AM5/18/17
to cobr...@googlegroups.com

Probably as simple as `pip install python-libsbml`.

--
You received this message because you are subscribed to the Google Groups "cobra pie" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cobra-pie+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bhushan Dhamale

unread,
May 19, 2017, 5:18:07 AM5/19/17
to cobra pie
Thank you for your timely reply Moritz.
As per your suggestion, I tried pip install python-libsbml. However, I am encountering errors during installations.
I tried installation with and without root access. I am attaching images of the installation errors.
libsbml error.png
root libsbml error.png

Justin Taylor

unread,
May 19, 2017, 11:34:31 AM5/19/17
to cobra pie
You are using pip correctly, because you can navigate to https://pypi.python.org/pypi/python-libsbml and see that the package exists.

The issue is most likely due to lack of internet connection. The error "network unreachable" bit supports that theory. 

In addition, you may want to look into using a virtual environment (https://python-guide-pt-br.readthedocs.io/en/latest/dev/virtualenvs/).

# in your working directory 
pip install virtualenv
virtualenv venv
. venv/bin/activate
Reply all
Reply to author
Forward
0 new messages