Installation#

Installing PhyloZoo#

PhyloZoo is a Python package that runs on Python (>= 3.10). Install PhyloZoo using pip from PyPI. Choose one of:

  • Minimal — Core only: NumPy, Numba, NetworkX.

    pip install phylozoo
    
  • With plotting (recommended) — Adds Matplotlib for network visualization.

    pip install phylozoo[viz]
    
  • With Graphviz layouts — Adds Matplotlib and PyGraphviz for additional layout algorithms (dot, neato, fdp, etc.). Requires the Graphviz system library to be installed separately (see troubleshooting below).

    pip install phylozoo[graphviz]
    

For development and contributing to PhyloZoo, install the latest source version in editable mode:

git clone https://github.com/nholtgrefe/phylozoo.git
cd phylozoo
pip install -e ".[dev]"

Requirements#

PhyloZoo keeps its core dependencies minimal. The mandatory requirements are:

  • NumPy >= 1.20.0 (for numerical operations)

  • NetworkX >= 3.0.0 (for graph operations)

  • Numba >= 0.56.0 (for JIT compilation of computationally intensive algorithms)

Optional (install via extras):

  • Matplotlib >= 3.5.0 (for plotting; use phylozoo[viz] or phylozoo[graphviz])

  • PyGraphviz (for Graphviz layouts; use phylozoo[graphviz]; requires Graphviz system library)

Verifying Installation#

To verify that PhyloZoo is installed correctly, you can import it and print the version. The latest version is 0.1.1.

>>> import phylozoo
>>> print(phylozoo.__version__)
x.y.z  # your installed version

>>> from phylozoo import DirectedPhyNetwork
>>> net = DirectedPhyNetwork(edges=[(1, 2), (1, 3)], nodes=[(2, {'label': 'A'}), (3, {'label': 'B'})])
>>> print(net.leaves)
[2, 3]

Building Documentation#

To build the documentation locally, install the optional documentation dependencies using the docs extra:

pip install -e ".[docs]"
cd docs
make html

This extra installs the main documentation tools:

Or with sphinx-autobuild for live reloading:

sphinx-autobuild source build/html

Troubleshooting#

Import errors: Ensure you’re using Python >= 3.10. Check that all dependencies are installed:

pip check phylozoo

Visualization not working / ``PhyloZooImportError``: The viz module requires Matplotlib. Install the viz extra:

pip install phylozoo[viz]

Graphviz layouts (dot, neato, fdp, etc.) not working: You need both the Graphviz system library and the pygraphviz Python package. Install the graphviz extra:

pip install phylozoo[graphviz]

You must also install the Graphviz system library (e.g. apt install graphviz graphviz-dev on Debian/Ubuntu, brew install graphviz on macOS). See the PyGraphviz installation guide for details.