{"id":21121,"library":"dendropy","title":"DendroPy","description":"A Python library for phylogenetics and phylogenetic computing: reading, writing, simulation, processing and manipulation of phylogenetic trees (phylogenies) and characters. Current version 5.0.8 (requires Python >=3.7). The library has undergone major API changes from v4 to v5 (e.g., removal of deprecated modules, new tree structure classes). Release cadence is irregular, with v5.0.0 released in late 2023 and subsequent bugfix releases.","status":"active","version":"5.0.8","language":"python","source_language":"en","source_url":"https://github.com/jeetsukumaran/DendroPy","tags":["phylogenetics","phylogeny","tree","bioinformatics","evolution"],"install":[{"cmd":"pip install dendropy","lang":"bash","label":"Install DendroPy"}],"dependencies":[],"imports":[{"note":"Tree class is now directly available under dendropy (since v4). Using dendropy.tree is deprecated and may be removed.","wrong":"from dendropy.tree import Tree","symbol":"Tree","correct":"from dendropy import Tree"},{"note":"TaxonNamespace is now directly under dendropy; the old path was restructured in v5.","wrong":"from dendropy.datamodel import taxonmodel","symbol":"TaxonNamespace","correct":"from dendropy import TaxonNamespace"}],"quickstart":{"code":"import dendropy\ntree = dendropy.Tree()\n# Read from a file (Newick example)\ntree = dendropy.Tree.get(path='example.tre', schema='newick')\nprint(tree.as_string(schema='newick'))","lang":"python","description":"Load a tree from a Newick file and print it."},"warnings":[{"fix":"Update imports to use the new 'dendropy' top-level namespace. Refer to migration guide on GitHub.","message":"DendroPy v5 introduced breaking changes: removal of deprecated modules (e.g., 'dendropy.utility', 'dendropy.dataio') and renaming of some classes. Code written for v4 may not work directly.","severity":"breaking","affected_versions":"<5.0.0"},{"fix":"Double-check the file format and use the correct schema string. For example, use schema='nexus' for NEXUS files.","message":"When reading trees, ensure the schema argument matches the file format exactly (e.g., 'newick', 'nexus', 'nexml'). Incorrect schema often leads to 'No tree found' or parsing errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Specify the correct schema, e.g., Tree.get(..., schema='nexus') for NEXUS files. Ensure file contains tree data.","cause":"Incorrect schema argument or file contains no trees (e.g., only taxon definitions).","error":"dendropy.exception.DendroPyError: No trees found in file."},{"fix":"Replace 'dendropy.tree' with 'dendropy.Tree'.","cause":"Old code trying to access 'dendropy.tree' directly (v4 pattern). 'tree' is no longer a submodule; use 'dendropy.Tree'.","error":"AttributeError: module 'dendropy' has no attribute 'tree'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}