在为 pdftotext 构建轮子时,命令'gcc'失败,退出状态为 1



我正在使用Python 3.7.0,Django 3.0.4,并尝试在Heroku中托管。我正在使用Windows操作系统,我发现的大多数解决方案是在Linux上。每次我尝试推入Heroku的主人时,都会发生以下错误。谁能帮我?

ERROR: Command errored out with exit status 1:
remote:           command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vu13x6kn/pdftotext/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vu13x6kn/pdftotext/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'rn'"'"', '"'"'n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-quoxq88r
remote:               cwd: /tmp/pip-install-vu13x6kn/pdftotext/
remote:          Complete output (14 lines):
remote:          /app/.heroku/python/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
remote:            warnings.warn(msg)
remote:          running bdist_wheel
remote:          running build
remote:          running build_ext
remote:          building 'pdftotext' extension
remote:          creating build
remote:          creating build/temp.linux-x86_64-3.6
remote:          gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=0 -I/app/.heroku/python/include/python3.6m -c pdftotext.cpp -o build/temp.linux-x86_64-3.6/pdftotext.o -Wall
remote:          pdftotext.cpp:3:10: fatal error: poppler/cpp/poppler-document.h: No such file or directory
remote:           #include <poppler/cpp/poppler-document.h>
remote:                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
remote:          compilation terminated.
remote:          error: command 'gcc' failed with exit status 1
remote:          ----------------------------------------
remote:          ERROR: Failed building wheel for pdftotext

如果要部署到 Heroku,则可能会部署到 Ubuntu Linux(版本 16 或 18,具体取决于您选择的内容(:

https://devcenter.heroku.com/articles/stack

我不使用 Heroku,但这看起来你缺少必要的开发库。您需要安装libpoppler-cpp-dev.如果你有自己的 Ubuntu 安装,你会这样做:

apt-get install libpoppler-cpp-dev

但是,我相信您需要使用它来通过 Heroku 上的apt安装:https://github.com/heroku/heroku-buildpack-apt

祝你好运!

相关内容

  • 没有找到相关文章

最新更新