Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Installing Psycopg2 on MacOS 10.9.5

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:

Running setup.py egg_info for package psycopg2  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'.  Complete output from command python setup.py egg_info:  running egg_info  writing pip-egg-info/psycopg2.egg-info/PKG-INFO   writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt   writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt   warning: manifest_maker: standard file '-c' not found   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 in /Users/sg/build/psycopg2 Storing complete log in /Users/sg/Library/Logs/pip.log 
like image 203
sg_sg94 Avatar asked Nov 23 '15 08:11

sg_sg94


People also ask

Could not find a version that satisfies the requirement psycopg2?

Queries related to “could not find a version that satisfies the requirement psycopg2” You may install a binary package by installing 'psycopg2-binary' from PyPI. If you want to install psycopg2 from source, please install the packages required for the build and try again. PyPI 'psycopg2-binary' package instead.

Does psycopg2 work with Python 3?

The current psycopg2 implementation supports: Python 2 versions from 2.6 to 2.7. Python 3 versions from 3.2 to 3.6. PostgreSQL server versions from 7.4 to 9.6.

Is psycopg2 the same as psycopg2-binary?

psycopg2-binary and psycopg2 both give us the same code that we interact with. The difference between the two is in how that code is installed in our computer.


1 Answers

I ran pip install psycopg2-binary and it worked like charm

More info about the binary package

like image 158
Laban Avatar answered Nov 02 '22 04:11

Laban