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

ModuleNotFoundError: No module named 'weasyprint.fonts' #1419

Closed
judahpaul16 opened this issue Aug 7, 2021 · 5 comments
Closed

ModuleNotFoundError: No module named 'weasyprint.fonts' #1419

judahpaul16 opened this issue Aug 7, 2021 · 5 comments

Comments

@judahpaul16
Copy link

I could not import weasyprint.fonts after clean pip install. This appears to be a bug with version 53. I rolled back to ver 52.5 and all is well.

@liZe
Copy link
Member

liZe commented Aug 7, 2021

Hello!

I could not import weasyprint.fonts after clean pip install. This appears to be a bug with version 53. I rolled back to ver 52.5 and all is well.

Could you please provide the whole backtrace please?

@york-schlabrendorff-liqid

Had a similar issue. Apparently the import path has changed. This works for me:

from weasyprint.text.fonts import FontConfiguration  # for weasyprint 53
# from weasyprint.fonts import FontConfiguration  # for weasyprint 52

@liZe
Copy link
Member

liZe commented Aug 9, 2021

Oh, of course… The last comment is right. The API change is documented in the changelog.

@Alex-CodeLab
Copy link

still not working.
Release: 5.15.0-52-generic

WeasyPrint version: 57.1
Python version: 3.10.6

@liZe
Copy link
Member

liZe commented Nov 9, 2022

still not working.
Release: 5.15.0-52-generic

The problem is not in Weasyprint, it’s in the code using WeasyPrint. WeasyPrint’s API has changed, there’s no weasyprint.fonts module anymore. Use weasyprint.text.fonts instead.

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

4 participants