Skip to content

Instantly share code, notes, and snippets.

@prakashanantha
Created October 15, 2014 22:51
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save prakashanantha/f957e6a9a193ac1bd8bf to your computer and use it in GitHub Desktop.
Save prakashanantha/f957e6a9a193ac1bd8bf to your computer and use it in GitHub Desktop.
Installing psycopg2 on a mac
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install postgresql
sudo pip install psycopg2
@NickZay
Copy link

NickZay commented Jul 28, 2023

brew install postgresql may not work,
use brew tap homebrew/core at first

@FFengIll
Copy link

pip3 install psycopg2-binary worked for me

thanks.

@IQExotic
Copy link

pip3 install psycopg2-binary worked for me

Thanks!

@rkechols
Copy link

Regarding psycopg2 vs psycopg2-binary, I'd just like to point to the official docs explaining the difference, including potential problems with psycopg2-binary:
https://www.psycopg.org/docs/install.html#psycopg-vs-psycopg-binary

In any case, brew install postgresql worked for me to be able to then pip install psycopg2 without issue

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