我过去成功地使用过这个
from subprocess import call
与
import os
为了确保打印路径正确,我在打印后查看了控制台
print str(os.path.abspath(str(os.path.join(settings.MEDIA_ROOT, 'user_2/SampleIllustration.pdf'))))])
这个路径/目录肯定存在;但是,在尝试将pdf转换为文本文件后
call(["pdftotext", "-layout", str(os.path.abspath(str(os.path.join(settings.MEDIA_ROOT, 'user_2/SampleIllustration.pdf'))))])
我收到一个错误
No such file or directory
奇怪的是,当我在本地机器上开发时,这个call
按预期工作。只有当我在服务器上时,我才会收到此消息
编辑:
完整的错误消息是:
OSError: [Errno 2] No such file or directory
目前没有回答
相关问题 更多 >
编程相关推荐