This buildpack is identical to the official python, but also installs any NLTK corpora/packages desired. Desired packages should be defined in
.nltk_packages in the root of the repo. Packages will only be downloaded if both this file exists and
nltk is installed among your dependencies.
.nltk_packages file can contain either space-separated packages, or one package on each line.
Deploying a Python application couldn't be easier:
$ echo "punkt brown" > .nltk_packages $ ls -a .nltk_packages Procfile requirements.txt web.py $ heroku create --buildpack https://github.com/megacool/heroku-buildpack-python-nltk $ git push heroku master ... -----> Python app detected $ pip install -r requirements.txt -----> Downloading NLTK packages punkt brown [nltk_data] Downloading package punkt to /app/nltk_data... [nltk_data] Unzipping tokenizers/punkt.zip. [nltk_data] Downloading package brown to [nltk_data] /app/nltk_data... [nltk_data] Unzipping taggers/brown.zip. -----> Discovering process types Procfile declares types -> (none)
requirements.txt file must be present at the root of your application's repository.
You can also specify the latest production release of this buildpack for upcoming builds of an existing application:
$ heroku buildpacks:set https://github.com/megacool/heroku-buildpack-python-nltk
Specific versions of the Python runtime can be specified with a
$ cat runtime.txt python-3.5.1
Runtime options include:
Other unsupported runtimes are available as well. Use at your own risk.
Copy the snippet above into CLI.