为pdftotext生成控制盘时,命令“gcc”失败,退出状态为1

2024-10-02 22:32:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用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('"'"'\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

Tags: installpippybuildappherokuremoterunning
1条回答
网友
1楼 · 发布于 2024-10-02 22:32:50

如果您要部署到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

祝你好运

相关问题 更多 >