Unable to install psycopg2 on mac using Interactive installer by EDB

Viewed 16

Problem Statement

Hello guys, I am trying to install psycopg2 to integrate PostGreSQL 14 with Python-Django, on my Mac OS.

I installed PostGreSQL 14 via EBD found on this link.

When I run on my terminal, the bellow command :

pip3 install psycopg2

I get an error Error: pg_config executable not found.

Solutions tried without success

It seems to be a common and well-documented error on the internet. None of the solutions below have worked for me so far :

  • 1 pip3 install psycopg2-binary

    Error : missing pg_config
    
  • 2 which pg_config

    Error : pg_config not found
    
  • 3 pip3 install --upgrade wheel then 'pip3 install psycopg2-binary'

    Error: pg_config executable not found.
    
  • 4 brew install postgresql

    Error: zsh: command not found: brew
    
1 Answers

RESOLVED

I needed to install HomeBrew, then run

export PATH=/opt/homebrew/bin:$PATH


brew install postgresql

pip3 install psycopg2
Related