问题描述
我使用 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):
- 下载可执行文件,将.exe扩展名重命名为。 zip
- 提取文件内容。
- 将psycopg2文件夹复制到MyEnv / Lib
- 复制鸡蛋到MyEnv / Lib / site-packages
- Download the executable, rename the .exe extension to .zip
- Extract the file contents.
- Copy the psycopg2 folder to MyEnv/Lib
- Copy the egg to MyEnv/Lib/site-packages
这篇关于在Windows上的virtualenv中安装Psycopg2(PostgreSQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!