我正在尝试使用模块 python 条形码创建一个应用程序,当我原始编译它时,它运行良好,但是当我尝试将其转换为 exe (使用 pyinstaller)时,这给了我错误
File "barcode\base.py", line 67, in save
File "barcode\ean.py", line 95, in render
File "barcode\base.py", line 102, in render
File "barcode\writer.py", line 188, in render
File "barcode\writer.py", line 280, in _paint_text
File "PIL\ImageFont.py", line 959, in truetype
File "PIL\ImageFont.py", line 956, in freetype
File "PIL\ImageFont.py", line 247, in __init__
OSError: cannot open resource
我当前正在运行的代码
bar_code = 310400070000555
bar_code = str(bar_code)
bar_code_obj = EAN13(bar_code, writer=ImageWriter())
bar_code_obj.save("bar_code_img")
有以上错误的人请查看这篇文章