[BioPython] How to check BioPython version
Peter
biopython at maubp.freeserve.co.uk
Thu Feb 19 05:23:40 EST 2009
On Thu, Feb 19, 2009 at 4:29 AM, Timothy Wu <2huggie at gmail.com> wrote:
> Hi,
>
> I've got BioPython installed some time ago, and I don't know which version
> I'm using. Where do I check the BioPython version?
Sadly we don't have an official mechanism. This was discussed with a
proposed solution late last year. Perhaps we should actually do this
now... See here for the details:
http://lists.open-bio.org/pipermail/biopython-dev/2008-September/004267.html
However, assuming your Biopython is fairly recent this should work:
$ python
>>> import Martel
>>> print Martel.__version__
1.49
Martel is a text parsing library we used to use and ship with
Biopython - it has been deprecated but is still included with
Biopython. The point of this is that for a while now we've kept its
version number in sync with the main Biopython version, so the version
of Martel should be the version of Biopython. If you don't have
mxTextTools installed, this will fail with an ImportError.
$ python
>>> import Martel
...
ImportError: No module named TextTools
In this case, just have a quick look at the Martel/__init__.py file,
look at the error message to see where exactly the file is on your
machine.
$ grep "__version__"
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Martel/__init__.py
__version__ = "1.49"
> Additionally, is there a standard way to check the version number
> for any Python package?
Lots of python packages use this __version__ convention (but not all). e.g.
$ python
>>> import numpy
>>> print numpy.__version__
1.1.1
Peter
More information about the BioPython
mailing list