Edit this page on GitHub

Download

Current Release - 1.70 - 10 July 2017

See also What’s new.

Files

Biopython 1.70

Installation Instructions

Recent versions of Python (starting with Python 2.7.9 and Python 3.4) include the Python package management tool pip, which allows an easy installation from the command line on all platforms. Try:

pip install biopython

For updating an older version of Biopython try:

pip install biopython --upgrade

This will delete older versions of Biopython and NumPy before it installs the recent versions.

If pip is not already installed you may need to update your Python, but first try:

python -m ensurepip

If you need to install under a specific version of Python, try something like this:

python2.7 -m pip install biopython
python3.6 -m pip install biopython
pypy -m pip install biopython

On Windows, by default python and pip are not on the PATH. You can re-install Python and tick this option, or give the full path instead. Try something like this, depending on where your copy of Python is installed:

C:\Python27\Scripts\pip install biopython

Installation from Source

Installation from source requires an appropriate C compiler, for example GCC on Linux, and MSVC on Windows. For Mac OS X, or as it is now branded, macOS, if you want to compile Biopython from source you will need to have installed Apple’s command line tools, which can de done with the terminal command:

xcode-select --install

This will offer to install Apple’s XCode development suite - you can, but it is not needed and takes a lot of disk space.

You can then download and unzip a Biopython source code release, or get our code from GitHub. Then run:

pip install .

If you are still stuck, sign up to the Biopython mailing list and ask for help there.

Required Software

Optional Software

Some parts of Biopython use the following additional python libraries:

In addition Biopython includes wrapper code for calling a number of third party command line tools including:

Packages

We would now recommend pip, however for those of you using Linux, you can alternatively install Biopython through your Linux distribution’s package management system. However, unless you are running a recent release of your Linux Distribution, you may find that the Biopython packages available to be a little out of date. You might want to see if there is a backport available, otherwise you will have to install Biopython using pip or from compiled from source.

Ubuntu or Debian

You should be able to install Biopython and its dependencies using the Synaptic GUI tool (on the main menu under System / Administration / Synaptic Package Manager), or at the command line using:

sudo apt-get install python-biopython

If you want the documentation and unit tests,

sudo apt-get install python-biopython-doc

And if you want to use BioSQL,

sudo apt-get install python-biopython-sql

However, this will probably not be the latest release (see Ubuntu listing here, and Debian listing here). If you want the latest version of Biopython, you will need to install it from source. However, you should be able to automatically install the build dependencies with the following command:

sudo apt-get build-dep python-biopython

Archlinux

Biopython is in the official Archlinux repository as python-biopython (for Python 3) or python2-biopython (for Python 2) and can be installed using pacman:

pacman -S python2-biopython

Or, for Python 3:

pacman -S python-biopython

Fedora

Biopython is an official Fedora package (since Fedora 5). The package is named python-biopython for Python 2, or python3-biopython for Python 3, and can be installed using yum as root:

yum install python-biopython

or

yum install python3-biopython

or via one of the GUI package management systems such as pirut and PackageKit (available in F-9 and later).

Gentoo Linux

Gentoo’s portage tree contains an ebuild (sci-biology/biopython) which builds from source. To install it, open a terminal as root and run:

emerge -va biopython

Here is a link to Biopython at Gentoo which shows the latest versions in Gentoo’s Portage tree.

Ports

FreeBSD

The most easy way of installing Biopython in FreeBSD is through the Ports Collection. If you’re new to this procedure please take a look at this document. Supposing that you’re familiar with this method and that you have an up-to-date ports tree, all you need to do is to execute the following commands as root:

cd /usr/ports/biology/py-biopython make install clean

Due to the great architecture of the ports system, this simple commands will automatically fetch and install Biopython (as well as its necessary dependencies).

Old Releases

Recent releases of Biopython require NumPy (and not Numeric):

Please note that Biopython 1.48 and older require the Numeric library, not its replacement NumPy. Windows installers for Python 2.4 and older are available from the Numerical Python website. A Windows installer for Numeric 24.2 for Python 2.5 is available here:

Please note that Biopython 1.48 and older used mxTextTools 2.0 in some of the parsers. There were a few niggles with mxTextTools 3.0, so ideally install the older mxTextTools 2.0.