Where are dependent libraries stored in Heroku? Where are dependent libraries stored in Heroku? heroku heroku

Where are dependent libraries stored in Heroku?


Seems that lately (as of January 2016), the dependencies are installed at this location:

app/.heroku/python/lib/python2.7/site-packages/

You can see the contents of your site-packages as it sits on heroku by running this command:

$ heroku run ls .heroku/python/lib/python2.7/site-packages/


The short answer is that the site packages live in /app/.heroku/venv/lib/python2.7/site-packages. If you want to take a look around you can open a remote shell using `heroku run -app [app_name] bash'. However, you probably don't want to just edit the packages in place since there's no guarantee that heroku won't wipe that clean and start fresh using your requirements.txt for another instance. Instead, if you need to customize a package a good strategy is to create your own fork of the project's code and then specify your customized fork in the requirements.txt.

For example, I use django-crowdsourcing for one of my sites, but needed to customize the code. So I created my own fork on google code and pointed to this custom fork using the following entry in requirements.txt:

-e hg+https://evangrim@code.google.com/r/evangrim-django-crowdsourcing/@b824d8f377b5bc2706d9755650e3f35061f3e309#egg=django_crowdsourcing-dev

This tells pip to checkout a copy of my fork and use it to install the package into heroku's virtualenv for my app. Doing things this way is much more robust since it works within the pip installation framework that heroku expects you to use.