gpt4 book ai didi

ModuleNotFoundError: No module named 'weasyprint'(ModuleNotFoundError:没有名为“weasyprint”的模块)

转载 作者:bug小助手 更新时间:2023-10-22 14:29:36 29 4
gpt4 key购买 nike



I have installed WeasyPrint==0.42.3 using pip3 install WeasyPrint==0.42.3, but when I try to import it in Django, it raises the following error:

我已经使用pip3安装了WeasyPrint==0.42.3,但当我试图在Django中导入它时,它会引发以下错误:


ModuleNotFoundError: No module named 'weasyprint'

When I look at the requirements.txt, it actually shows that it is installed.

当我查看requirements.txt时,它实际上显示它已安装。


I am using Django==2.1.5, python==3.8.5. another issue I am encountering is, the version of Django I am using is not listed in the requirements.txt, but when I check the version from the terminal, it shows that I am using the above named version.

我使用的是Django==2.1.5,python==3.8.5。我遇到的另一个问题是,requirements.txt中没有列出我使用的Django版本,但当我从终端检查版本时,它表明我使用的是上面命名的版本。


更多回答

How exactly did you install it?

你到底是怎么安装的?

I used; pip3 install WeasyPrint==0.42.3

我曾经;pip3安装WeasyPrint==0.42.3

It's possible that you've installed the package into different python installation. Are you using virtualenv?

您可能已将该软件包安装到不同的python安装中。你在用virtualenv吗?

I was able to collect it by adding the path to its location using; export 'PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.8/dist-packages' . Thank you for taking your time.

我能够通过使用添加路径到它的位置来收集它;export'PYTHONPATH=$PYTHONPATH:/usr/local/lib/python3.8/dist packages'。感谢您抽出时间。

优秀答案推荐

pip install django-weasyprint

this worked for me

这对我有用


更多回答

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com