How to fix ModuleNotFoundError: No module named 'reportlab.graphics.barcode.code93' in pyinstaller?

问题描述 投票:0回答:2

我正在使用 pyinstaller v5.0.1 将 python 文件转换为 .exe,但是当我运行 exe 文件时出现此错误:

ModuleNotFoundError: No module named 'reportlab.graphics.barcode.code93'

请注意,python 文件运行良好,我什至没有在我的代码中使用 code93。

python pyinstaller barcode reportlab
2个回答
1
投票

我已经通过为所有这些库添加一个导入来解决这个问题,即使我不使用它们也是如此:

from reportlab.graphics.barcode import code93
from reportlab.graphics.barcode import code39
from reportlab.graphics.barcode import usps
from reportlab.graphics.barcode import usps4s
from reportlab.graphics.barcode import ecc200datamatrix

0
投票

我也做了你做的并且成功了。我很确定修复它的正确方法是使用隐藏的导入。但我是 Python 的新手,我发现弄清楚如何真正做到这一点有点难以理解。也许其他人会偶然发现这个知道如何使用隐藏导入的人,并且能够为下一个人更新这个线程。

© www.soinside.com 2019 - 2024. All rights reserved.