by yuxiaosun


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.


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 -a [app-name]
$ git push heroku master


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".


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.