I was having the same Issue on Mac.
The solution was to use only PIP to install everything, and touch some things.
First install PIP from: https://pip.pypa.io/en/latest/
Then you want to make sure if path to pg_config is in your PATH (echo $PATH), if not you can edit your bash_profile:
vi /Users/<user>/.bash_profile
and add this line:
export PATH=$PATH:/path/to/pg_config/bin
If you don't know where pg_config is you can use the "locate" tool, but be sure your locate.db is up to date (i was using an old locate.db and using paths that does not exists).
sudo /usr/libexec/locate.updatedb
locate pg_config
Then install Django (if needed) and psycopg2.
sudo pip install Django
sudo pip install psycopg2
And then in settings.py (localhost:defaultport)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'dbname',
'USER': 'postgres',
'PASSWORD': 'postgres',
'HOST': '',
'PORT': '',
}
}
Greets!