condanltk-buildpack

by yuxiaosun

GitHub Readme.md

CondaNLTK Buildpack

This is a Heroku Buildpack that enables and integrates the installation of binary packages through Conda, PIP and NLTK Downloader.

The buildpack is built to install packages such as scikit-learn and NLTK Data that official buildpack cannot handle. The default environment is Python 3 with Miniconda3.

Installation

You can add it to an existing application using Heroku CLI. To avoid downloading duplicated packages, please do not use other python buildpacks concurrently.

$ heroku buildpacks:add https://github.com/yuxiaosun/condanltk-buildpack.git -a [app-name]
$ git push heroku master

Usage

To install python packages, add the following text files under your app's root directory:

  • conda-requirements.txt: list packages installed by conda, split by new line.
  • requirements.txt: list packages installed by pip, split by new line.
  • nltk.txt: list data packages installed by nltk.downloader(), split by space. Don't forget to list "nltk" in conda-requirements.txt or "requirements.txt".

Tip

This buildpack will result in a large slug size upon first deployment to heroku app (~300MB). Subsequent builds will be much smaller (~200MB). You can also refer to this article for reducing slug size.

Reference