For me (on ubuntu), worked running:
sudo apt-get install libpq-dev and then running sudo pip install psycopg2 , If you run without sudo it won't work.
sudo apt-get install libpq-dev
pip install psycopg2