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
@yajing-wang
Copy link

Thanks!

@mahesh122000
Copy link

but asking password

@sham-hq
Copy link

sham-hq commented Mar 13, 2020

pip3 install psycopg2-binary
worked for me

@liujiajun
Copy link

cool

@ruddhisundar
Copy link

pip3 install psycopg2-binary

Thank you, Sham-HQ! It also worked for me on my mac! Jaya SeeyaRaam!

@KozlovDmitry
Copy link

pip3 install psycopg2-binary
worked for me

Thanks, it works for me too

@niravlogistic
Copy link

pip3 install psycopg2-binary

worked for me also

@abhinaypotti
Copy link

pip3 install psycopg2-binary
worked for me

Thank you.. Worked for me too

@tinaty
Copy link

tinaty commented Apr 22, 2021

pip3 install psycopg2-binary
worked for me

thank you very much, this way worked for me too.

@erickvilela
Copy link

erickvilela commented May 2, 2021

pip3 install psycopg2-binary

Thank you, Sham-HQ! It also worked for me on my mac! Jaya SeeyaRaam!

Much easier than everything I've tried so far. For the virtualEnv, worked pretty fine! Thank you!

@Pankaj1417
Copy link

pip3 install psycopg2-binary worked for me
worked for me too

@vinydanylo
Copy link

brew install postgresql
pip3 install psycopg2

Worked for me, thanks!

@bobbytayar
Copy link

brew install postgresql
pip3 install psycopg2

Worked for me! Thanks

@bwill09
Copy link

bwill09 commented Jul 28, 2022

Thanks below worked
pip3 install psycopg2-binary

@Wole99
Copy link

Wole99 commented Aug 15, 2022

thanks installation worked

@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