在Windows上的virtualenv中安装Psycopg2(PostgreSQL) [英] Installing psycopg2 (postgresql) in virtualenv on windows

查看:92
本文介绍了在Windows上的virtualenv中安装Psycopg2(PostgreSQL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 easy_install psycopg2 在virtualenv中安装了psycopg2。我没有看到任何错误,看起来安装正常。.在psycopg2的站点软件包目录中创建了一个鸡蛋文件。

I installed psycopg2 in virtualenv using easy_install psycopg2. I did not see any errors and looks like installation went fine.. there is an egg file created in the site-packages dir for psycopg2..

但是当我运行import时在解释器中的psycopg2,我得到以下错误..任何线索?我该如何解决..在virtualenv中安装psycopg2的任何其他方法。

but when I run import psycopg2 in the interpreter, I am getting following error.. any clue? How can I fix it.. any other way to install psycopg2 in virtualenv..

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build\bdist.win32\egg\psycopg2\__init__.py", line 69, in <module>
  File "build\bdist.win32\egg\psycopg2\_psycopg.py", line 7, in <module>
  File "build\bdist.win32\egg\psycopg2\_psycopg.py", line 6, in __bootstrap__

谢谢。

推荐答案

编辑:此解决方案已过时。 请参阅此答案

this solution is outdated. Refer to this answer instead.

我遇到了同样的问题。按照Windows端口的下载页面上的建议进行操作在Zope上,我在virtualenv下也为我工作(也在非虚拟安装中):

I had the same problem. Following the suggestion on the download page of the Windows port for getting it working on Zope worked for me under virtualenv (also in the non-virtual install):


  1. 下载可执行文件,将.exe扩展名重命名为。 zip

  2. 提取文件内容。

  3. 将psycopg2文件夹复制到MyEnv / Lib

  4. 复制鸡蛋到MyEnv / Lib / site-packages

  1. Download the executable, rename the .exe extension to .zip
  2. Extract the file contents.
  3. Copy the psycopg2 folder to MyEnv/Lib
  4. Copy the egg to MyEnv/Lib/site-packages

这篇关于在Windows上的virtualenv中安装Psycopg2(PostgreSQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆