I’m trying to install Psycopg2
on my Macbook, but I am getting an error. I found a lot of the same questions on StackOverflow but no answer seems to work.
I’m using:
OS: MacOS 10.9.5
Python Version: 3.4.3
My error code is:
JavaScript
x
34
34
1
Running setup.py egg_info for package psycopg2 Error: pg_config
2
executable not found.
3
4
Please add the directory containing pg_config to the PATH or specify
5
the full executable path with the option:
6
7
python setup.py build_ext --pg-config /path/to/pg_config build
8
9
or with the pg_config option in 'setup.cfg'. Complete output from
10
command python setup.py egg_info: running egg_info
11
12
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
13
14
writing top-level names to
15
pip-egg-info/psycopg2.egg-info/top_level.txt
16
17
writing dependency_links to
18
pip-egg-info/psycopg2.egg-info/dependency_links.txt
19
20
warning: manifest_maker: standard file '-c' not found
21
22
Error: pg_config executable not found.
23
24
Please add the directory containing pg_config to the PATH or specify the full executable path with the option:
25
26
python setup.py build_ext --pg-config /path/to/pg_config build
27
28
or with the pg_config option in 'setup.cfg'.
29
30
----------------------------------------
31
Command python setup.py egg_info failed with error code 1 in
32
/Users/sg/build/psycopg2 Storing complete log in
33
/Users/sg/Library/Logs/pip.log
34
Advertisement
Answer
I ran pip install psycopg2-binary
and it worked like charm
More info about the binary package
Python 3
JavaScript
1
2
1
pip3 install psycopg2-binary
2