Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError from toytree (ScrollableCanvas) #6

Open
isaacovercast opened this issue Dec 23, 2022 · 7 comments
Open

ImportError from toytree (ScrollableCanvas) #6

isaacovercast opened this issue Dec 23, 2022 · 7 comments

Comments

@isaacovercast
Copy link

With current versions of ipcoal (0.4.0) and toytree (2.0.5) on import ipcoal gives this error:

image

@isaacovercast
Copy link
Author

If i switch to ipcoal 0.3.1 it fixes this.

@antecede
Copy link

antecede commented Dec 2, 2023

but it returns this:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[1], line 1
----> 1 import ipcoal
      2 # import toytree
      3 
      4 # generate a random tree with 8 tips and height of 1M generations
   (...)
      7 # # draw tree showing idx labels
      8 # tree1.draw(tree_style='p');

File ~/Software/miniconda3/envs/trans/lib/python3.9/site-packages/ipcoal/__init__.py:11
      8 __version__ = "0.3.1"
      9 __author__ = "Patrick McKenzie and Deren Eaton"
---> 11 from ipcoal.Model import Model  # class clobbers module name on purpose
     12 from ipcoal.utils import utils
     13 from ipcoal.utils.logger_setup import set_loglevel

File ~/Software/miniconda3/envs/trans/lib/python3.9/site-packages/ipcoal/Model.py:18
     15 from loguru import logger
     17 # from ipcoal.markov.SeqModel import SeqModel
---> 18 from ipcoal.phylo.TreeInfer import TreeInfer
     19 from ipcoal.io.writer import Writer
     20 from ipcoal.utils.utils import get_admix_interval_as_gens, IpcoalError

ModuleNotFoundError: No module named 'ipcoal.phylo'

@eaton-lab
Copy link
Owner

@antecede

Sorry some big updates are on the horizon but yet to be pushed out. Here is the best install instructions currently:

# get dependencies from conda
conda install toytree ipcoal -c conda-forge --only-deps

# pip install from github development branches
git clone https://github.com/eaton-lab/toytree -b toy3
cd toytree/
pip install -e . --no-deps

git clone https://github.com/eaton-lab/ipcoal -b toy3
cd ipcoal/
pip install -e . --no-deps

# Note: it will be available in the near future to simply do:
# conda install ipcoal -c conda-forge

@antecede
Copy link

antecede commented Dec 5, 2023

Thank you very much! Great work! I am looking forward to your team's fabulous updates! Keep going and never give these packages up.
Additionally, another package is also needed. conda install -c conda-forge loguru

@antecede
Copy link

antecede commented Dec 5, 2023

When I try to reproduce according to the tutorial like that below:

# a dictionary of arguments to style the drawings
kwargs = {
    "ts": "c",
    "tip_labels": True,
    "shared_axis": True,
    "width": 600,
    "height": 200,
    "node_sizes": 6,
}

# draw a grid of trees from model 1
toytree.mtree(unlinked.df.genealogy).draw_tree_grid(**kwargs);

# draw a grid of trees from model 2
toytree.mtree(linked.df.genealogy).draw_tree_grid(**kwargs);

I encountered this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[17], line 12
      2 kwargs = {
      3     "ts": "c",
      4     "tip_labels": True,
   (...)
      8     "node_sizes": 6,
      9 }
     11 # draw a grid of trees from model 1
---> 12 toytree.mtree(unlinked.df.genealogy).draw_tree_grid(**kwargs);
     14 # draw a grid of trees from model 2
     15 toytree.mtree(linked.df.genealogy).draw_tree_grid(**kwargs);

AttributeError: 'MultiTree' object has no attribute 'draw_tree_grid'

Is this tutorial outdated or another error of dependencies?

@eaton-lab
Copy link
Owner

eaton-lab commented Dec 5, 2023 via email

@antecede
Copy link

antecede commented Dec 6, 2023

Thank you very much! BTW, merry Christmas 🤶

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants