Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.920 runs
build_error
glibcpy 3.10–3.920 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Tree
✓ from ete3 import Tree
PhyloTree
✓ from ete3 import PhyloTree
TreeStyle
✓ from ete3 import TreeStyle
✗ from ete3.treeview import TreeStyle
All core drawing classes are usually imported directly from `ete3`.
NodeStyle
✓ from ete3 import NodeStyle
AttrFace
✓ from ete3 import AttrFace
TextFace
✓ from ete3 import TextFace
This quickstart demonstrates how to create a simple phylogenetic tree from a Newick string, access and annotate its nodes, and prepare a custom visualization style. For graphical output (rendering to file or interactive display), `PyQt5` is required.
from ete3 import Tree, TreeStyle, NodeStyle, TextFace
# Create a tree from a Newick string
t = Tree("((A:1.0,B:1.0):0.5,C:1.5);")
# Print the tree topology to console
print("Tree topology:")
print(t.get_ascii(show_length=True))
# Access nodes and add features
for node in t.traverse():
node.add_features(my_feature="value")
if node.is_leaf():
print(f"Leaf name: {node.name}, feature: {node.my_feature}")
else:
print(f"Internal node: {node.name if node.name else 'Unnamed'}, feature: {node.my_feature}")
# Create a custom tree style
ts = TreeStyle()
ts.show_branch_length = True
ts.show_branch_support = True
ts.show_leaf_name = True
ts.title.add_face(TextFace("My Phylogenetic Tree"), column=0)
# Render the tree to a file (requires PyQt5)
# t.render("my_tree.png", w=600, h=600, tree_style=ts)
# For interactive visualization (requires PyQt5 and an X server/display)
# t.show(tree_style=ts)
print("Quickstart complete. For visualization, uncomment t.render() or t.show() and ensure PyQt5 is installed.")
ete3 --version
Debug
Known issues
breakingETE 4 (released as `ete4` on PyPI, but also updating the `ete` package) introduced significant breaking API changes from ETE 3. Code written for ETE 3 will not run directly with ETE 4 without modifications.fixIf migrating to ETE 4, consult the 'Migrating from ETE 3' documentation. If staying with ETE 3, ensure you install `ete==3.1.3` or `ete<4`.
affects: ete>=4.0.0
deprecatedPython 2 support was officially dropped in ETE 3.1.2. While ETE 3.1.0 and 3.1.1 had some Python 3 compatibility, 3.1.2 onward is Python 3-focused. Python 3.6 was specifically recommended for full compatibility with the `ete_toolchain` package. Using newer Python versions (e.g., 3.9+) might encounter issues with older `ete3` components.fixUse Python 3.6 for optimal compatibility, especially with `ete_toolchain`. If using a newer Python 3 version, be prepared for potential dependency conflicts or runtime errors with certain `ete3` modules.
affects: <3.1.2 (for Python 2.x), >3.6 (for `ete_toolchain` issues)
gotchaGraphical features (e.g., `Tree.show()`, `Tree.render()`) in ETE 3 rely on PyQt. Early `ete3` versions had compatibility issues with `PyQt5 >= 5.12`, leading to rendering problems. These were largely addressed in ETE 3.1.3. Conflicts with `PyQt4` and `PyQt5` installations, or missing `xvfb` for headless rendering, are common sources of errors.fixEnsure `ete==3.1.3` is installed. For graphical features, install `PyQt5` (`pip install PyQt5`) or `PyQt4` (for older versions/environments where it's still available). If running in a headless environment, `xvfb` might be needed (`sudo apt-get install xvfb`). Check your display server configuration.
affects: <3.1.3 (for PyQt5>=5.12), all (for PyQt setup issues)
gotcha`ete3-build` and `ete3-evol` commands often require external bioinformatics tools (e.g., MAFFT, FastTree, Codeml) which are not bundled with the core `ete` Python package. These are best installed via the `ete_toolchain` Conda package. Manual compilation or incorrect paths can lead to command failures.fixUse the Conda installation method with `conda install -c etetoolkit ete ete_toolchain`. If manual installation is necessary, run `ete3 upgrade-external-tools` and address any compilation errors for individual tools. Ensure external tool binaries are in your system's PATH.
affects: All `ete3` versions using `ete3-build` or `ete3-evol`.
Upgrade
Version history
1.0.0latest on PyPI · released May 17, 2021
Audit
Dependencies
numpyoptionalRequired for array and cluster tree support.
lxmloptionalOptional, required for PhyloXML/NexML format parsing.
PyQt5optionalOptional, required for graphical tree visualization and image rendering (e.g., `tree.show()`, `tree.render()`). PyQt4 also compatible with older 3.x versions.
sixrequiredPython 2/3 compatibility layer (though Python 2 support dropped in 3.1.2).
ete_toolchainoptionalMeta-package providing external tools for phylogenetic analysis (e.g., alignment, tree inference) used by `ete3-build` and `ete3-evol`. Primarily available via Conda.