kylemacfarlane / zplgrf

Python utilities for converting to and from ZPL, GRF, PDF, and images
GNU General Public License v3.0
52 stars 11 forks source link

FileNotFoundError when running in windows env #12

Closed Rajatkalsotra closed 4 months ago

Rajatkalsotra commented 4 months ago

Python version: 3.12.0 pillow==10.3.0 setuptools==69.2.0 zplgrf==1.6.0

Traceback (most recent call last):
  File "C:\Users\*****\file.py", line 7, in <module>
    pages = GRF.from_pdf(pdf.read(),'TEST', center_of_pixel=hasBarcode,width=sys.argv[2],height=sys.argv[3], dpi=sys.argv[5])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\*****\AppData\Local\Programs\Python\Python312\Lib\site-packages\zplgrf\__init__.py", line 477, in from_pdf    
    p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\*****\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\*****\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1537, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified
kylemacfarlane commented 4 months ago

You probably don't have Ghostscript (gs.exe) installed.