[英]ImportError: DLL load failed : - when trying to import psycopg2 library
>>> import psycopg2 Traceback (most recent call last): File "", line 1, in File "C:\Python26\lib\site-packages\psycopg2\__init__.py", line 60, in from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID ImportError: DLL load failed: The application has failed to start because its si de-by-side configuration is incorrect. Please see the application event log for more detail.
I get this error when trying to import psycopg2 .. I've searched for days, and found no solutions.尝试导入psycopg2时出现此错误。我已经搜索了几天,但没有找到解决方案。 I've tried installing the Visual C++ 2008 Package, but I still get the same error.我已尝试安装 Visual C++ 2008 包,但仍然遇到相同的错误。
On Windows, make sure your path includes the Postgres bin directory.在 Windows 上,确保您的路径包含 Postgres bin 目录。 In my machine it's c:\\Programs\\PostgreSQL\\9.3\\bin.在我的机器上它是 c:\\Programs\\PostgreSQL\\9.3\\bin。
您也可以尝试从这里安装 win-psycopg
尝试运行以下命令:
pip install psycopg2-binary
It is a problem with virtualenv
and psycopg2
.这是virtualenv
和psycopg2
的问题。 I have copied _psycopg.cp38-win_amd64.pyd
from global python to \\venv\\Lib\\site-packages\\psycopg2
This worked for me.我已将_psycopg.cp38-win_amd64.pyd
从全局 python 复制到\\venv\\Lib\\site-packages\\psycopg2
这对我\\venv\\Lib\\site-packages\\psycopg2
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.