当我的开发系统上没有安装Postgresql时,是否可以将
原文链接:https://www.f2er.com/postgresql/193792.htmlpsycopg2
安装到virtualenv中?MacBook Pro with OS X 10.6?
当我运行pip install psycopg2从我的virtualenv,我收到如下所示的错误。
我试图连接到使用Django的服务器上的遗留@R_301_457@,我不想在我的开发系统上安装Postgresql如果可能的话。
为什么不安装Postgresql?
我收到一个错误,当使用homebrew安装Postgresql。我有Xcode4,只有Xcode4安装在我的MacBook Pro,我认为它与缺少gcc 4.0相关。但是,这是另一个StackOverflow问题的问题。
更新2011年4月12日上午8:37:我仍然想知道如果这是可能的,而不是在我的MacBook Pro上安装Postgresql。但是,我运行brew更新和强制重新安装ossp-uuid与brew install –force ossp-uuid和现在brew安装postgresql工作。与Postgresql成功安装,我能够安装psycopg2从我的virtualenv。
错误pip安装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
初步研究
以下是我作为初步研究阅读的文章:
> Installing psycopg2 to use Django with PostgreSQL on OS X
> Installing psycopg2 on OS X
> Using psycopg2 with virtualenv on Ubuntu JauntyLucid
> Postgres,psycopg2,virtualenv install hints