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]
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])
Graphviz layouts (optional)#
PhyloZoo’s own layouts (pz-cladogram, pz-layered, pz-radial, pz-unrooted) are the
recommended way to draw networks and need nothing beyond phylozoo[viz]. The Graphviz layouts
(dot, neato, twopi, …) can additionally be used if PyGraphviz
is installed; it needs the Graphviz system library (e.g. apt install graphviz graphviz-dev on
Debian/Ubuntu, brew install graphviz on macOS) and then
pip install pygraphviz
See the PyGraphviz installation guide for platform details.
Verifying Installation#
To verify that PhyloZoo is installed correctly, you can import it and print the version. The latest version is 0.4.2.
>>> 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: These need the Graphviz system library
and the pygraphviz package, see Graphviz layouts (optional) above. The PhyloZoo layouts do
not need them.