python - 无法在heroku上安装reportlab

标签 python heroku reportlab

我尝试在heroku上安装reportlab 2.7,但编译失败。

我生成了一台带有远程 shell 的机器并尝试编译它。启动 python setup.py build 时出现的错误如下

gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DRENDERPM_FT -DLIBART_COMPILATION -DLIBART_VERSION="2.3.12" -I/app/reportlab-2.7/src/rl_addons/renderPM -I/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl -I/app/reportlab-2.7/src/rl_addons/renderPM/gt1 -I/usr/include -I/usr/include/freetype2 -I/app/.heroku/python/include/python2.7 -c /app/reportlab-2.7/src/rl_addons/renderPM/gt1/gt1-region.c -o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/gt1/gt1-region.o
gcc -pthread -shared build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/_renderPM.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_vpath_bpath.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_rgb_pixbuf_affine.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_rgb_svp.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_svp.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_svp_vpath.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_svp_vpath_stroke.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_svp_ops.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_vpath.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_vpath_dash.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_affine.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_rect.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_rgb_affine.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_rgb_affine_private.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_rgb.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_rgb_rgba_affine.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_svp_intersect.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_svp_render_aa.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/libart_lgpl/art_misc.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/gt1/gt1-parset1.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/gt1/gt1-dict.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/gt1/gt1-namecontext.o build/temp.linux-x86_64-2.7/app/reportlab-2.7/src/rl_addons/renderPM/gt1/gt1-region.o -L/usr/local/lib -L/usr/lib -L/app/.heroku/python/lib -L/app/.heroku/python/lib -lfreetype -lpython2.7 -o build/lib.linux-x86_64-2.7/_renderPM.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

为什么会失败?我一年前创建的另一个应用程序从未遇到过这个问题。

我怀疑构建包已更改,但我不明白其中的区别,也不知道如何修复它。

最佳答案

好消息!

reportlab 错误现已通过 python-2.7.7 运行时修复。

关于python - 无法在heroku上安装reportlab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24097490/

相关文章:

python - 如何对 numpy.ndarray 对象的子集应用函数

python - Django 表单需要默认 HTML

python - 使用 gdata docs python v3.0 和 ocr 上传 pdf 文件

ssl - 处理付款和搭载 ssl

python - Flask session 不会持续存在于 heroku 上

python - pyinstaller 和 reportlab 的问题

python - 如何以列而不是行的形式显示表格中的数据?

Python Selenium : input textbox, send_keys 不工作

haskell - shakespeare-js 无法在 Heroku 上编译

python - ReportLab 表的列跨越 PDF 页面上的所有行?