无法在OSX Anaconda上安装psycopg2

时间:2017-02-24 10:18:39

标签: python anaconda psycopg2 osx-elcapitan

这就是我得到的:

Adnans-MBP:~ AdnanAhmad$ easy_install psycopg2
Searching for psycopg2
Reading https://pypi.python.org/simple/psycopg2/
Downloading https://pypi.python.org/packages/7b/a8/dc2d50a6f37c157459cd18bab381c8e6134b9381b50fbe969997b2ae7dbc/psycopg2-2.6.2.tar.gz#md5=4a392949ba31a378a18ed3e775a4693f
Best match: psycopg2 2.6.2
Processing psycopg2-2.6.2.tar.gz
Writing /var/folders/d3/t5c58nx570ggzzknhm4zpjnw0000gn/T/easy_install-66rCLK/psycopg2-2.6.2/setup.cfg
Running psycopg2-2.6.2/setup.py -q bdist_egg --dist-dir /var/folders/d3/t5c58nx570ggzzknhm4zpjnw0000gn/T/easy_install-66rCLK/psycopg2-2.6.2/egg-dist-tmp-Vu8qsu
In file included from psycopg/psycopgmodule.c:27:
./psycopg/psycopg.h:31:10: fatal error: 'libpq-fe.h' file not found
#include <libpq-fe.h>
         ^
1 error generated.
error: Setup script exited with error: command 'gcc' failed with exit status 1

我正在使用PostgreSql.app

1 个答案:

答案 0 :(得分:1)

好吧,既然你正在使用anaconda,不妨利用他们的二进制包!他们有一个PostgreSQL!只需输入

conda install psycopg2