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

AttributeError: 'ImageDraw' object has no attribute 'textsize' #68

Closed
noahmueller97 opened this issue Dec 8, 2023 · 1 comment
Closed

Comments

@noahmueller97
Copy link

Hello there,

Thank you very much for providing this great tool. After following the steps in your trycycler guide I wanted to create a dotplot using the following command,

trycycler dotplot --cluster_dir trycycler/cluster_001

as it is written in the guide. Unfortunately I received the following error:

Traceback (most recent call last):
  File "/home/noah/miniconda3/envs/research_project/bin/trycycler", line 10, in <module>
    sys.exit(main())
  File "/home/noah/miniconda3/envs/research_project/lib/python3.10/site-packages/trycycler/__main__.py", line 45, in main
    dotplot(args)
  File "/home/noah/miniconda3/envs/research_project/lib/python3.10/site-packages/trycycler/dotplot.py", line 43, in dotplot
    image = create_dotplots(seq_names, seqs, args)
  File "/home/noah/miniconda3/envs/research_project/lib/python3.10/site-packages/trycycler/dotplot.py", line 90, in create_dotplots
    draw_labels(image, seq_names, start_positions, end_positions, text_gap, outline_width,
  File "/home/noah/miniconda3/envs/research_project/lib/python3.10/site-packages/trycycler/dotplot.py", line 174, in draw_labels
    get_font(draw, name, font_size, start_positions[name], end_positions[name])
  File "/home/noah/miniconda3/envs/research_project/lib/python3.10/site-packages/trycycler/dotplot.py", line 253, in get_font
    text_width, text_height = draw.textsize(label, font=font)
AttributeError: 'ImageDraw' object has no attribute 'textsize'

After creating a new environment and using python version 3.9 the issue still persisted. Then I found a related issue here from October 27, 2021. Following your advice and therefore replacing the dotplot.py file with the one you provided solved the problem for me. Nevertheless I wanted to let you know that the issue might still persist.

Ubuntu release: 22.04
Trycycler version: v0.5.4

Thank you and have a nice weekend.

Cheers,

Noah

@rrwick
Copy link
Owner

rrwick commented Apr 2, 2024

This should be fixed in the latest release of Trycycler (v0.5.5) which is now on Bioconda.

Ryan

@rrwick rrwick closed this as completed Apr 2, 2024
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

2 participants