简体   繁体   English

如何通过 django python 中的子进程运行 unoconv?

[英]How to run unoconv via subprocess in django python?

If I run unoconv -f pdf test_pdf.docx in terminal, it's working fine.如果我在终端中运行 unoconv -f pdf test_pdf.docx,它工作正常。 But if I run it in subprocess, I got this error但是如果我在子进程中运行它,我会收到这个错误

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

Please help me resolve this problem请帮我解决这个问题

Yes, this throws the error, also there are already a lot of closed issues on GitHub related to the issue.是的,这会引发错误,而且 GitHub 上已经有很多与该问题相关的已关闭问题

The most useful answers are 49#issuecomment-416317222 and 49#issuecomment-464011493 .最有用的答案是49#issuecomment-41631722249#issuecomment-464011493 It is hard to believe but the problem came from 2012 and still does not has a proper fix.很难相信,但问题来自 2012 年,仍然没有适当的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM