当PostgreSQL未安装在开发系统上时,将psycopg2安装到virtualenv

当PostgreSQL未安装在开发系统上时,将psycopg2安装到virtualenv,第1张

概述当我的开发系统上没有安装PostgreSQL时,是否可以将 psycopg2安装到virtualenv中?MacBook Pro with OS X 10.6? 当我运行pip install psycopg2从我的virtualenv,我收到如下所示的错误。 我试图连接到使用Django的服务器上的遗留数据库,我不想在我的开发系统上安装PostgreSQL如果可能的话。 为什么不安装Postgr 当我的开发系统上没有安装Postgresql时,是否可以将 psycopg2安装到virtualenv中?MacBook Pro with OS X 10.6?

当我运行pip install psycopg2从我的virtualenv,我收到如下所示的错误。

我试图连接到使用Django的服务器上的遗留数据库,我不想在我的开发系统上安装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 psycopg2Downloading/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_infowriting pip-egg-info/psycopg2.egg-info/PKG-INFOwriting top-level names to pip-egg-info/psycopg2.egg-info/top_level.txtwriting dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txtwarning: manifest_maker: standard file '-c' not foundError: pg_config executable not found.Please add the directory containing pg_config to the PATHor 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 1Storing 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

psycopg依赖于pg_config命令,如果你没有它,你不能安装psycopg。

如果系统安装是一个问题,为什么不尝试编译Postgresql和包括生成的bin文件在$ PATH?喜欢:

export PATH=/path/to/compiled/postgresql/bin:"$PATH"pip install psycopg2
总结

以上是内存溢出为你收集整理的当PostgreSQL未安装在开发系统上时,将psycopg2安装到virtualenv全部内容,希望文章能够帮你解决当PostgreSQL未安装在开发系统上时,将psycopg2安装到virtualenv所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1172737.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存