首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Azure函数请求pdftotext

Azure函数请求pdftotext
EN

Stack Overflow用户
提问于 2021-01-31 10:07:51
回答 1查看 168关注 0票数 1

我发现Azure函数出现了一个运行时错误:

代码语言:javascript
复制
Result: Failure Exception: Exception: pdftotext is not installed. It is part of xpdf or poppler-utils software suite. 
Installation on Linux: wget --no-check-certificate https://dl.xpdfreader.com/xpdf-tools-linux-4.02.tar.gz && tar -xvf xpdf-tools-linux-4.02.tar.gz && sudo cp xpdf-tools-linux-4.02/bin64/pdftotext /usr/local/bin 
Installation on MacOS: brew install xpdf 
You can find more details here: https://www.xpdfreader.com 
Stack: File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/dispatcher.py", line 357, in _handle__invocation_request self.__run_sync_func, invocation_id, fi.func, args) File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run result = self.fn(*self.args, **self.kwargs) 
File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/dispatcher.py", line 542, in __run_sync_func return func(**params) File "/home/site/wwwroot/testFunction/__init__.py", line 45, in main searchResult = bootLoader.run(filePath, query) 
File "/home/site/wwwroot/testFunction/bootLoader.py", line 44, in run doc = docPrepare(filePath) File "/home/site/wwwroot/testFunction/bootLoader.py", line 19, in docPrepare converter = PDFToTextConverter(remove_numeric_tables=True, valid_languages=["en"]) File "/home/site/wwwroot/testFunction/haystack/file_converter/pdf.py", line 38, in __init__ """
Error

该函数在我的计算机上成功运行,因为我已经在本地安装了xpdf。我的问题是如何将pdftotext安装到我的函数的运行环境(linux)?

ENV

python 3.6

MAC

通过vs代码蔚蓝函数扩展进行部署

更新

我参观了https://{FunctionAppName}.scm.azurewebsites.net/

EN

回答 1

Stack Overflow用户

发布于 2021-01-31 10:52:10

您可以使用函数应用程序中的Kudu控制台,然后您需要导航到www根文件夹并执行pip安装。

我在这个帖子的最后一节中描述了

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65977860

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档