Deploying a Django App to OpenShift 3.0 that needs NLTK

195 views Asked by At

I am working on a Django project needing Newspaper3K to retrieve some information over the internet. Trying to deploy my Django web app onto the free OpenShift Online 3.0 Starter, the build fails when it comes to installing the Newspaper3K and hence its dependency NLTK.

Please advise the correct steps to achieve this "Django with NLTK deploying to OpenShift 3" installation. Thanks!

1

There are 1 answers

3
David Lee On

It turned out to be blocked by the lxml package. The default version of pip fails to compile it. Thanks to the answer here https://stackoverflow.com/a/46125643/8583561 I set the environment variable

UPGRADE_PIP_TO_LATEST=1

This should be added to the .s2i/environment file.

This enables the PIP to be updated to the latest and the build is completed without an issue.