【发布时间】:2012-04-25 07:30:05
【问题描述】:
我正在尝试在本地 Mac OS X 上使用 Postgresql 后端运行 Django。我已经使用 pip 安装了 Django:
sudo pip install Django
我已经使用其中一个二进制安装程序 here 安装了 Postgresql。
但是当我尝试安装 psycopg2 时,我收到一个错误(粘贴在下面),它找不到 pg_config。
从this question 看来我应该安装libpq-dev,但我不确定如何安装。
我尝试使用 MacPorts 安装 libpqxx,但没有任何效果。
如何安装 libpg-dev?还是我还缺少其他东西?
henrietta:~ $ pip install psycopg2
Downloading/unpacking psycopg2
Downloading psycopg2-2.4.5.tar.gz (719Kb): 719Kb downloaded
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
creating pip-egg-info/psycopg2.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
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.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
Storing complete log in /Users/thomas/.pip/pip.log
【问题讨论】:
标签: python django postgresql psycopg2