Fix WeasyPrint import error

Created on Thursday 14 October 2021, 15:44

Back to task list
  • ID
    1004851
  • Project
    Metabolism of Cities
  • Status
    Completed
  • Priority
    Medium
  • Type
    Programming work
  • Assigned to
    Paul Hoekman
  • Subscribers
    Guus Hoekman
    Paul Hoekman

You are not logged in

Log In Register

Please join us and let's build things, together!

Description

When running sudo docker-compose build, WeasyPrint will give an error:

web_1 | from . import views
web_1 | File "/src/core/views.py", line 36, in <module>
web_1 | from weasyprint.fonts import FontConfiguration
web_1 | ModuleNotFoundError: No module named 'weasyprint.fonts'

Related: https://github.com/Kozea/WeasyPrint/issues/1426

See line 2120 or search for from weasyprint import HTML, CSS in views.py

Discussion and updates


New task was created


Task was assigned to Paul Hoekman


I'll have a look at this in due course. For my own note taking, this changelog reports a new syntax for the api, which likely resolves this.


Just re-installed the repo and there were no errors.


Status change: Open → Completed