Skip to content

OSError - %1 is not a valid Win32 applicationΒ #16

@sbi-rviot

Description

@sbi-rviot

I am running the basic example as follow:

import pydf
pdf = pydf.generate_pdf('<h1>this is html</h1>')
with open('test_doc.pdf', 'wb') as f:
    f.write(pdf)

and I get the following error:

Traceback (most recent call last):
  File "pdytest.py", line 2, in <module>
    pdf = pydf.generate_pdf('<h1>this is html</h1>')
  File "C:\Program Files\Python37\lib\site-packages\pydf\wkhtmltopdf.py", line 145, in generate_pdf
    p = _execute_wk(*cmd_args, input=html.encode())
  File "C:\Program Files\Python37\lib\site-packages\pydf\wkhtmltopdf.py", line 30, in _execute_wk
    return subprocess.run(wk_args, input=input, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
  File "C:\Program Files\Python37\lib\subprocess.py", line 472, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Program Files\Python37\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Program Files\Python37\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
OSError: [WinError 193] %1 is not a valid Win32 application

I am using python 3.7.
Could you please help?
Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions