这是我在 python 中的代码
import pydf
pdf = pydf.generate_pdf('<h1>Empresa Jucla</h1>')
with open('test_doc.pdf', 'wb') as f:
f.write(pdf)
并产生此错误:
C:\Users\Administrator\Envs\juppe\Scripts\python.exe C:/Users/Administrator/PycharmProjects/juppe/modulos_externos.py
Traceback (most recent call last):
File "C:/Users/Administrator/PycharmProjects/juppe/modulos_externos.py", line 32, in <module>
pdf = pydf.generate_pdf('<h1>Empresa Jucla</h1>')
File "C:\Users\Administrator\Envs\juppe\lib\site-packages\pydf\wkhtmltopdf.py", line 145, in generate_pdf
p = _execute_wk(*cmd_args, input=html.encode())
File "C:\Users\Administrator\Envs\juppe\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:\users\administrator\appdata\local\programs\python\python38-32\lib\subprocess.py", line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "c:\users\administrator\appdata\local\programs\python\python38-32\lib\subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "c:\users\administrator\appdata\local\programs\python\python38-32\lib\subprocess.py", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 is not a valid Win32 application
请帮助我使用 Windows 10 x64