解决pip报错Error: pg_config executable not found.

报错如下:

1
2
3
4
5
6
7
8
running egg_info
creating /tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info
writing /tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info/top_level.txt
writing manifest file '/tmp/pip-pip-egg-info-ez6k71_8/psycopg2_binary.egg-info/SOURCES.txt'

Error: pg_config executable not found.

原因是系统缺少postgresql-devel这个包。

解决:

1
yum install postgresql-devel

重新运行pip安装,问题解决。