deeplook / svglib

Read SVG files and convert them to other formats.
GNU Lesser General Public License v3.0
311 stars 80 forks source link

V1.2.1 Broken import #316

Closed yeyeto2788 closed 2 years ago

yeyeto2788 commented 2 years ago

Hey guys! I just found out that there is a broken import on module with latest version (1.2.1) I tried latest version of a software using the library and it seems to be related to the library itself as installing older version (1.1.0) fixes the issue.

OS: Ubuntu 20.04 Python: 3.8.10

Error:

ModuleNotFoundError: No module named 'reportlab.graphics.transform'

Traceback:

yeyeto2788@juan-thinkbook:~$ flatcam
Traceback (most recent call last):
  File "/home/yeyeto2788/flatcam/FlatCAM.py", line 6, in <module>
    from app_Main import App
  File "/home/yeyeto2788/flatcam/app_Main.py", line 32, in <module>
    from svglib.svglib import svg2rlg
  File "/home/yeyeto2788/.local/lib/python3.8/site-packages/svglib/svglib.py", line 36, in <module>
    from reportlab.graphics.transform import mmult
ModuleNotFoundError: No module named 'reportlab.graphics.transform'

If more info is needed just ping me. Best.

github-actions[bot] commented 2 years ago

Thank you for raising your first issue! Your help to improve svglib is much appreciated!

claudep commented 2 years ago

Thanks for the report. Yes, this import is new, and it appears reportlab.graphics.transform only exists since reportlab 3.5.61 (mmult was in reportlab.graphics.shape before), so a conditional import should be done here. You may upgrade your reportlab installation meanwhile.

yeyeto2788 commented 2 years ago

Thanks for the heads up and for the quick reply.