What I’m trying to do:
Create pdf with PDFRender
What I’ve tried and what’s not working:
requires sudo permision
Code Sample:
pdf_file = PDFRenderer(filename=title).render_form("HomePage.AIAnalyses.AIAnalysis", scenario=scenario, title=title)
Exception in thread Thread-3555 (run_browser):
Traceback (most recent call last):
File “/usr/local/lib/python3.10/threading.py”, line 1016, in _bootstrap_inner
self.run()
File “/usr/local/lib/python3.10/threading.py”, line 953, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.10/site-packages/anvil_downlink_host/pdf_renderer.py”, line 170, in run_browser
with subprocess.Popen(CHROME_SUDO_PREFIX + [“bash”, “-c”, cmd], stderr=subprocess.PIPE, stdout=subprocess.PIPE, preexec_fn=os.setsid) as process:
File “/usr/local/lib/python3.10/subprocess.py”, line 971, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File “/usr/local/lib/python3.10/subprocess.py”, line 1863, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: ‘sudo’