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

时间:2020-06-07 17:49:03

标签: python django heroku pdftotext

我正在使用Python 3.7.0,Django 3.0.4,并试图在Heroku中托管。我正在使用Windows OS,而我发现的最多解决方案是在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('"'"'\r\n'"'"', '"'"'\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

1 个答案:

答案 0 :(得分:-1)

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

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

我不使用Heroku,但这看起来好像您缺少必要的开发库。您需要安装libpoppler-cpp-dev。如果您有自己的Ubuntu安装,则将执行以下操作:

apt-get install libpoppler-cpp-dev

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

上进行安装

祝你好运!