当前位置:  开发笔记 > 编程语言 > 正文

安装自定义构建heroku并使用库路径发出问题

如何解决《安装自定义构建heroku并使用库路径发出问题》经验,为你挑选了1个好方法。

我正在尝试在heroku上安装自定义构建,所以我使用各种方法尝试使用buildpacks进行第三方安装.在我的.buildpacks文件中,我有:

https://github.com/ddollar/heroku-buildpack-apt
https://github.com/heroku/heroku-buildpack-python.git

在我的Aptfile我有以下内容:libgeoip-dev这是geoip的先决条件,与requirements.txt(GeoIP==1.3.2)一起安装

这是我的环境变量:

remote: C_INCLUDE_PATH is /app/.heroku/vendor/include:/app/.heroku/vendor/include:/app/.heroku/python/include
remote: CPATH is /tmp/build_xxxxx/.apt/usr/include:
remote: LD_LIBRARY_PATH is /app/.heroku/vendor/lib:/app/.heroku/vendor/lib:/app/.heroku/python/lib

我得到的错误消息是:

remote:        building 'GeoIP' extension
remote:        creating build
remote:        creating build/temp.linux-x86_64-2.7
remote:        gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/app/.heroku/python/include/python2.7 -c py_GeoIP.c -o build/temp.linux-x86_64-2.7/py_GeoIP.o -fno-strict-aliasing
remote:        creating build/lib.linux-x86_64-2.7
remote:        gcc -pthread -shared build/temp.linux-x86_64-2.7/py_GeoIP.o -lGeoIP -o build/lib.linux-x86_64-2.7/GeoIP.so
remote:        /usr/bin/ld: cannot find -lGeoIP
remote:        collect2: error: ld returned 1 exit status
remote:        error: command 'gcc' failed with exit status 1

解决这个问题最聪明的方法是什么?即我想我无法改变软件包管理器的安装位置.有没有解决的办法?



1> dnozay..:

https://github.com/heroku/heroku-buildpack-python/blob/master/bin/compile#L99-L107

# Prepend proper path buildpack use.
export PATH=$BUILD_DIR/.heroku/python/bin:$BUILD_DIR/.heroku/vendor/bin:$PATH
export PYTHONUNBUFFERED=1
export LANG=en_US.UTF-8
export C_INCLUDE_PATH=/app/.heroku/vendor/include:$BUILD_DIR/.heroku/vendor/include:/app/.heroku/python/include
export CPLUS_INCLUDE_PATH=/app/.heroku/vendor/include:$BUILD_DIR/.heroku/vendor/include:/app/.heroku/python/include
export LIBRARY_PATH=/app/.heroku/vendor/lib:$BUILD_DIR/.heroku/vendor/lib:/app/.heroku/python/lib
export LD_LIBRARY_PATH=/app/.heroku/vendor/lib:$BUILD_DIR/.hero ku/vendor/lib:/app/.heroku/python/lib
export PKG_CONFIG_PATH=/app/.heroku/vendor/lib/pkg-config:$BUILD_DIR/.heroku/vendor/lib/pkg-config:/app/.heroku/python/lib/pkg-config

https://github.com/ddollar/heroku-buildpack-apt/blob/master/bin/compile#L75-L81

export PATH="$BUILD_DIR/.apt/usr/bin:$PATH"
export LD_LIBRARY_PATH="$BUILD_DIR/.apt/usr/lib/x86_64-linux-gnu:$BUILD_DIR/.apt/usr/lib/i386-linux-gnu:$BUILD_DIR/.apt/usr/lib:$LD_LIBRARY_PATH"
export LIBRARY_PATH="$BUILD_DIR/.apt/usr/lib/x86_64-linux-gnu:$BUILD_DIR/.apt/usr/lib/i386-linux-gnu:$BUILD_DIR/.apt/usr/lib:$LIBRARY_PATH"
export INCLUDE_PATH="$BUILD_DIR/.apt/usr/include:$INCLUDE_PATH"
export CPATH="$INCLUDE_PATH"
export CPPPATH="$INCLUDE_PATH"
export PKG_CONFIG_PATH="$BUILD_DIR/.apt/usr/lib/x86_64-linux-gnu/pkgconfig:$BUILD_DIR/.apt/usr/lib/i386-linux-gnu/pkgconfig:$BUILD_DIR/.apt/usr/lib/pkgconfig:$PKG_CONFIG_PATH"

heroku-buildpack-pythonbuildpack不与踢得好看heroku-buildpack-apt,因为它是针对重挫重要的变量buildpack gcc到您的Python扩展与链接geoip库.在问题跟踪器上提交错误.

问题跟踪器:https://github.com/heroku/heroku-buildpack-python/issues

推荐阅读
围脖上的博博_771
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有