【问题标题】:How to install poppler correctly for pdftotext如何为 pdftotext 正确安装 poppler
【发布时间】:2019-08-24 08:33:47
【问题描述】:

当我尝试构建我的 docker-compose pdftotext 似乎失败并出现此错误:

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 上进行了测试,但出现了同样的错误。有没有人找到解决这个问题的方法?

【问题讨论】:

    标签: docker-compose pdftotext poppler


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2019-02-19
      • 1970-01-01
      • 1970-01-01
      • 2021-09-08
      • 1970-01-01
      • 2015-01-29
      • 2013-08-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多