How to install psyc...
 
Share:
Notifications
Clear all

How to install psycopg2 with “pip” on Python?


Neha
 Neha
(@asha)
Member Admin
Joined: 1 year ago
Posts: 27
Topic starter  

How to install psycopg2 with “pip” on Python?
I'm using virtualenv and I need to install "psycopg2".
I have done the following:

pip install psycopg2

And I have the following messages:

Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in C:\Documents and Settings\anlopes\Application Data\pip\p
ip.log

Quote
Topic Tags
myTechMint
(@mytechmint)
Member Moderator
Joined: 1 year ago
Posts: 29
 

In ubuntu you can use the below commands in sequence this will properly install "psycopg2"

sudo apt-get update
sudo apt-get install libpq-dev python-dev
sudo pip install psycopg2

ReplyQuote