如何在heroku雪松上安装scikit-learn?

zen*_*poy 6 python heroku scikit-learn

我使用答案中描述的方法成功安装了numpy和scipy .然后我想添加scikit-learn所以首先我尝试添加scikit-learn==0.11到requirements.txt,当推送到heroku时,我收到一条错误消息:

ImportError: liblapack.so.3gf: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

所以我已添加到LD_LIBRARY_PATH我所拥有的路径,liblapack.so.3gf但后来我得到了这个:

ImportError: libgfortran.so.3: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我相信heroku没有fortran编译器,但也许我错了.我该如何解决这个问题?

小智 7

基于这些指针,我刚刚在heroku上完成了scikit-learn的安装.我很高兴看到没有必要获得自定义二进制文件,但设置一些环境做了诀窍:)

您可以在我的wyn buildpack的fork中找到其他自定义步骤:https: //github.com/ToonTimbermont/heroku-buildpack-python

关键是要为LD_LIBRARY_PATH设置正确的值: export LD_LIBRARY_PATH=$(pwd)/vendor/lib:$(pwd)/vendor/lib/atlas- base:$(pwd)/vendor/lib/atlas-base/atlas

我还将这些路径添加到heroku配置中: heroku config:add LD_LIBRARY_PATH=/app/.heroku/vendor/lib/atlas-base/atlas:/app/.heroku/vendor/lib/atlas-base:/app/.heroku/vendor/lib/