最佳答案
当 PostgreSQL 没有安装在我的开发系统ーー具有 OS X 10.6的 MacBook Pro 上时,是否有可能将 psycopg2安装到 virtualenv中?
当我从我的 virtualenv中运行 pip install psycopg2时,我收到了如下所示的错误。
我正在尝试使用 Django 连接到服务器上的遗留数据库,如果可能的话,我不希望在我的开发系统上安装 PostgreSQL。
在使用自制程序安装 PostgreSQL 时,我收到了一个错误。我的 MacBook Pro 上安装了 Xcode4ーー而且只安装了 Xcode4ーー我认为这与缺少 gcc 4.0有关。但是,这是另一个 StackOverflow 问题的问题。
更新于2011年4月12日上午8:37: 我仍然想知道不在我的 MacBook Pro 上安装 PostgreSQL 是否可行。但是,我运行了 brew update并用 brew install --force ossp-uuid强制重新安装了 ossp-uuid,现在 brew install postgresql可以工作了。成功安装了 PostgreSQL 之后,我就能够在 Virtual alenv 中使用 pip install psycopg2了。
pip install psycopg2的错误$ pip install psycopg2
Downloading/unpacking psycopg2
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
Storing complete log in /Users/matthew/.pip/pip.log
以下是我作为初步研究阅读的文章: