Where are dependent libraries stored in Heroku?

dependencies, django, heroku, python

Solution

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.

Problem

I've launched my app on Heroku but need to change one of the files of one the dependent libs that I installed in the requirements.txt file. On my local machine, this would just be in my virtual environment in lib > python2.7 > site-packages etc. Where are these dependencies stored within Heroku's file structure? When I go into the python folder in lib the site-packages doesn't seem to have my libraries there.

Original source