close

[Solved] Installing Psycopg2 on MacOS 10.9.5

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Installing Psycopg2 on MacOS 10.9.5 in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Installing Psycopg2 on MacOS 10.9.5 Error Occurs?

Today I get the following error Installing Psycopg2 on MacOS 10.9.5 in python.

How To Solve Installing Psycopg2 on MacOS 10.9.5 Error ?

  1. How To Solve Installing Psycopg2 on MacOS 10.9.5 Error ?

    To Solve Installing Psycopg2 on MacOS 10.9.5 Error Run manually command including the path of pg_config program in PATH env variable, in my case:

  2. Installing Psycopg2 on MacOS 10.9.5

    To Solve Installing Psycopg2 on MacOS 10.9.5 Error Run manually command including the path of pg_config program in PATH env variable, in my case:

Solution 1

You don’t seem to have postgres installed, check how to install postgresql in your system, one of the way is brew install postgresql (if you use homebrew- recommended) or download the postgres app from postgresapp.com, pg_config should come with postgres and psycopg2 is trying to find it.

Solution 2

To install psycopg2 you need have installed server before

Run manually command including the path of pg_config program in PATH env variable, in my case:

export PATH=/Applications/Postgres.app/Contents/Versions/@latest/bin/:$PATH

and then run

pip3 install psycopg2

EDIT:

Check directory of pg_config:

which pg_config

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read