我尝试在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/