How can I install packages on my heroku app?
Question: I have an app that makes use of shortuuid
(<https://pypi.python.org/pypi/shortuuid/0.1>) that is working fine locally
when I run it with runapp.py:

    
    
    import os
    
    from paste.deploy import loadapp
    from waitress import serve
    
    if __name__ == "__main__":
        port = int(os.environ.get("PORT", 5000))
        app = loadapp('config:production.ini', relative_to='.')
    
        serve(app, host='0.0.0.0', port=port)
    

It does not work, however, when I try and run it with ../bin/pserve
development.ini. I get the error: import error: no module named shortuuid.
When I push it to heroku I get the same error. I have installed shortuuid into
my virtual environment where my app is run and can only conclude that the
absence of this installation on heroku is whats causing the problem.

I have tried replacing the development.ini code with the production.ini code
and it still does not work so I assume its something else (maybe the import os
line on runapp.py?)


Answer: I usually create a `requirements.txt` file that contains the packages:

    
    
    Flask==0.9
    Jinja2==2.6
    Werkzeug==0.8.3
    distribute==0.6.27
    wsgiref==0.1.2
    
    Flask-Cache==0.10.0
    
    gunicorn==0.17.2
    

You can create that file with `pip`:

    
    
    $ pip freeze > requirements.txt
    

