Error with psycopg2

Generate SQLAlchemy Models from Postgres using sqlacodegen

To generate the models execute:

sqlacodegen postgresql://user:pass@host:5432/database

If you have the problem:

ImportError: No module named 'psycopg2'

Run:

sudo apt-get install build-dep python-psycopg2
pip install psycopg2