如何在Django python中通过子进程运行unoconv?

问题描述 投票:1回答:1

如果我在终端中运行unoconv -f pdf test_pdf.docx,则工作正常。但是,如果我在子进程中运行它,则会出现此错误

subprocess.run(['unoconv', '-f', 'pdf', path],  shell=True)

unoconv: Cannot find a suitable pyuno library and python binary combination in 
/usr/lib/libreoffice
ERROR: No module named 'uno'

unoconv: Cannot find a suitable office installation on your system.
ERROR: Please locate your office installation and send your feedback to:
   http://github.com/dagwieers/unoconv/issues

请帮助我解决此问题

python django subprocess unoconv
1个回答
1
投票
是的,这引发了错误,并且在GitHub上已经有很多与该问题相关的issues封闭:

最有用的答案是49#issuecomment-41631722249#issuecomment-464011493。很难相信,但是问题出自2012年,仍然没有适当的解决方法。

© www.soinside.com 2019 - 2024. All rights reserved.