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

我的错误代码是:

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

推荐答案

我跑了pip install psycopg2-binary,效果很好

More info about the binary package

Postgresql相关问答推荐

Postgres BULK INSERT如何影响Debezium?

无法在PostgreSQL中创建方案和表

使用postgres在go测试容器中使用tern迁移

Postgres 11没有强制执行外键约束?

在postgres中撤销Select后,RLS停止工作

使用doobie,如何将Scala case类映射到带有类型tstzmultirange的PostgreSQL列?

在连接字符串并将其附加到 PostgreSQL 中的 where 子句时出现语法错误.怎么修?

Postgres 生成的列不是不可变的

PostgreSQL TIMESTAMPTZ 不适用于 SpringBoot Java Query

我可以在 Ruby on Rails 上编写 PostgreSQL 函数吗?

PostgreSQL - 改变数字的精度?

获取 OperationalError: FATAL: sorry, too many clients already using psycopg2

在查询中的复合外键/主键列上连接表

判断值是否存在于列中

是否可以在 PostgreSQL 中部分刷新materialized视图?

如何为查询执行设置语句超时

如何将主键添加到视图?

防止 CHARACTER VARYING 字段中出现空字符串

PostgreSQL 中跨多个表的索引

PostgreSQL:如果不存在则创建表 AS