Skip to content

Instantly share code, notes, and snippets.

@pixyj
Last active December 28, 2015 08:09
Show Gist options
  • Save pixyj/7469721 to your computer and use it in GitHub Desktop.
Save pixyj/7469721 to your computer and use it in GitHub Desktop.
Install these psycopg2 dependencies on Ubuntu before pip install psycopg2 to fix below error: In file included from psycopg/psycopgmodule.c:27:0: ./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory compilation terminated. error: command 'gcc' failed with exit status 1
sudo apt-get install libpq-dev
#I'm running postgresql-9.1. Match the version to that of your server.
sudo apt-get install postgresql-server-dev-9.1
sudo apt-get install python-dev
#Now workon your virtualenv and pip install psycopg2
@kBashar
Copy link

kBashar commented Oct 8, 2014

Thanks, It helped 👍 :

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment