首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何为pdftotext正确安装poppler

如何为pdftotext正确安装poppler
EN

Stack Overflow用户
提问于 2019-08-24 16:33:47
回答 1查看 1.2K关注 0票数 0

当我尝试构建我的docker-compose pdftotext时,似乎失败了,错误如下:

代码语言:javascript
复制
Running setup.py install for pdftotext: finished with status 'error'
ERROR: Command errored out with exit status 1:
 command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ihm5qxa9/pdftotext/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ihm5qxa9/pdftotext/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wa_n7pgk/install-record.txt --single-version-externally-managed --compile
     cwd: /tmp/pip-install-ihm5qxa9/pdftotext/
Complete output (14 lines):
WARNING: pkg-config not found--guessing at poppler version.
         If the build fails, install pkg-config and try again.
running install
running build
running build_ext
building 'pdftotext' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -I/usr/local/include/python3.6m -c pdftotext.cpp -o build/temp.linux-x86_64-3.6/pdftotext.o -Wall
pdftotext.cpp:3:10: fatal error: poppler/cpp/poppler-document.h: No such file or directory
 #include <poppler/cpp/poppler-document.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

我已经在windows和linux上测试过了,也出现了同样的错误。有人找到解决这个问题的办法了吗?

EN

回答 1

Stack Overflow用户

发布于 2020-08-13 23:51:04

不幸的是,如果不知道docker-compose/Dockerfile的内容就很难帮上忙。但正如错误消息中提到的,您缺少pkg-config。您应该尝试运行apt-get install pkg-config

您还可以查看my answer,了解如何在Docker中使用最新版本的Poppler

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

https://stackoverflow.com/questions/57636362

复制
相关文章

相似问题

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