Installation
Biopython installs from PyPI with pip and works on Linux, macOS, and Windows. Most functionality is pure Python; a few optional extras (for PDB and some sequence formats) pull in small C extensions that ship as wheels.
Basic Install
pip install biopython
Verify
import Bio
print(Bio.__version__)
python -m pip show biopython
Use a Virtual Environment
python -m venv bioenv
source bioenv/bin/activate # Windows: bioenv\Scripts\activate
pip install biopython
A virtualenv keeps Biopython and its scientific stack (NumPy, pandas) out of your system Python.
Optional Extras
- NumPy and pandas - needed for Bio.Cluster and data-analysis workflows.
- matplotlib - for Bio.Phylo tree drawing and other plots.
- For remote access: a stable internet connection; Entrez and BLAST call NCBI web services.
Troubleshooting
- ImportError for a submodule usually means a missing optional dependency - install it (e.g., numpy).
- Old Python: check the PyPI page for the minimum Python version your Biopython release requires and upgrade the interpreter if needed.
- Corrupt install: pip install --force-reinstall biopython inside the venv.
A Note on Import Names
The package is imported as Bio (not biopython): from Bio import SeqIO. The PyPI name and the import name differ, which trips up first-timers - remember Bio.* for all imports.
Summary
Install Biopython with pip install biopython inside a virtual environment, verify with import Bio; print(Bio.__version__), and add NumPy/pandas/matplotlib for the analysis and plotting modules. Import everything from the Bio namespace - that is the single most common beginner confusion.