WhyNotHugo / python-barcode

㊙️ Create standard barcodes with Python. No external dependencies. 100% Organic Python.
http://python-barcode.rtfd.io/
MIT License
558 stars 123 forks source link

generating barcode error #207

Closed ShahwaizRaza closed 1 year ago

ShahwaizRaza commented 1 year ago

I am creating gui barcode generator, when I run my code in vs code it all works fine, but when I create an exe file, my exe file opens and when I enter my all fields and click on the generate button it shows an error, and not generate any barcode,

issue is:

Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1892, in __call__
  File "customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
    self._command()
  File "easybarfree.py", line 267, in generate_barcodes
    barcode.save(barcode_path)
  File "barcode\base.py", line 64, in save
  File "barcode\codex.py", line 255, in render
  File "barcode\base.py", line 100, in render
  File "barcode\writer.py", line 269, in render
  File "barcode\writer.py", line 440, 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
ShahwaizRaza commented 1 year ago

😃 finally after 3 days finally got a solution, by the way, thanks for your library 👍