没有名为 psycopg2 的模块 [英] No module named psycopg2

查看:84
本文介绍了没有名为 psycopg2 的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 postgresql 9 的 Django 项目.我安装了 psycopg2,当我运行项目时,我收到错误加载 psycopg2 模块:dll 加载失败".我第一次遇到这个问题.我有带有 python2.7 的 Windows 7 x64.我该如何解决这个问题?

解决方案

我遇到了同样的问题,psycopg2 在 Windows 中使用 _easy_install_ 安装得不好,我按照以下说明进行操作所以答案:

在 windows 上的 virtualenv 中安装 psycopg2 (postgresql)

您需要手动安装psycopg2 exe 文件:

psycopg2-2.4.2.win-amd64-py2.7-pg9.0.4-release.exe

I have Django project which uses postgresql 9. I installed psycopg2 and when I run project I receive 'Error loading psycopg2 module: dll load failed'. I met this issue for the first time. I have windows 7 x64 with python2.7. How can I solve this one?

解决方案

I had the same problem, it was that psycopg2 does not install well in Windows with _easy_install_, I followed the instructions on the follow SO answer:

Installing psycopg2 (postgresql) in virtualenv on windows

You need to manually install the psycopg2 exe file:

psycopg2-2.4.2.win-amd64-py2.7-pg9.0.4-release.exe

这篇关于没有名为 psycopg2 的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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