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

svglib dependency is missing #602

Closed
MacLake opened this issue Aug 1, 2022 · 9 comments · Fixed by #603
Closed

svglib dependency is missing #602

MacLake opened this issue Aug 1, 2022 · 9 comments · Fixed by #603

Comments

@MacLake
Copy link

MacLake commented Aug 1, 2022

After updating my project with pip-compile and pip-sync easy-thumbnails is bumped to 2.8.2 and svglib removed:

diff --git a/requirements.txt b/requirements.txt
[…]
-easy-thumbnails==2.8.1
+easy-thumbnails==2.8.2
     # via
     #   -r requirements.in
     #   aldryn-people
[…]
-svglib==1.3.0
-    # via easy-thumbnails
[…]

This leads to an error because in VIL/Image.py there’s an import from svglib:

  File "/home/jens/.virtualenvs/djangocms3.9/lib/python3.9/site-packages/easy_thumbnails/VIL/Image.py", line 10, in <module>
    from svglib.svglib import svg2rlg
ModuleNotFoundError: No module named 'svglib'

Adding svglib to requirements.in and running pip-compile && pip-sync fixes the problem, but the dependencies in easy-thumbnails should be fixed.

@jrief
Copy link
Collaborator

jrief commented Aug 2, 2022

Some users of easy-thumbnails complained, that they do not need SVG support and thus don't want to pull in the extra dependency reportlabs. Therefore this feature is optional. You can install pip install easy-thumbnails[svg] to fetch that extra dependencies.

@martin056
Copy link

We have the same problem. reportlab and svglib are missing. My workaround is to add these to the requirements file of my project:

reportlab==3.6.10
svglib==1.3.0
easy_thumbnails==2.8.2

@jrief
Copy link
Collaborator

jrief commented Aug 2, 2022

Instead you should just add

easy-thumbnails[svg]

to your requirements.txt file.

@SmileyChris
Copy link
Owner

(I'd suggest if we're changing core requirements / making breaking changes in the future, we use a major version bump)

@derek-adair
Copy link

derek-adair commented Aug 2, 2022

I'm getting a missing dep error with a fresh install of 2.8.2; pip install easy-thumbnails (not using the [svg] option).

django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'easy_thumbnails.templatetags.easy_thumbnails_tags': No module named 'reportlab'

simply trying to render a template manually;

<img src="{% thumbnail mymodel.image 50x50 crop %}" />

This is from following the README. When i pip install easy-thumbnails[svg] its working just fine.

@MacLake
Copy link
Author

MacLake commented Aug 2, 2022

Some users of easy-thumbnails complained, that they do not need SVG support and thus don't want to pull in the extra dependency reportlabs. Therefore this feature is optional.

Ok, Jacob, but now even ./manage.py check fails unless svglib is installed because of the import in VIL/Image.py.

@akx
Copy link
Contributor

akx commented Aug 2, 2022

My bad for not having properly checked whether everything works without svglib installed when implementing #597. Will be hopefully fixed by #603.

(I do agree this should have been shipped in a semver-minor, not a semver-patch release.)

@akx
Copy link
Contributor

akx commented Aug 3, 2022

So this should be fixed by upgrading to 2.8.3. Sorry again :)

@derek-adair
Copy link

Thx budy, much love to the OS maintainers round the world!

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

Successfully merging a pull request may close this issue.

6 participants