在windows下使用

easy_installpsycopg2安装psycopg2时安装成功,但在python中import psycopg2时却提示如下错误:

from psycopg2._psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: DLL load failed: 找不到指定的模块。

为何??

 ImportError: DLL load failed: The specified module could not be found.

the file _psycopg.pyd is a dll. For its relatively small size it is
probably dynamically linked to the libpq.dll. I think the system
either fails to find libpq.dll or some of the other dependencies (they
are listed in the setup.py).
I suggest you to use a tool to check its dll dependencies (maybe
http://www.dependencywalker.com/ could be ok) and see if there is
anything missing. If libpq.dll is the missing one, try putting it in a
PATH directory or in the psycopg2 package directory.


具体解决方案如下:
查找libpq.dll,将其copy到psycopg2的包中,或者放置在系统PATH下即可

相关文章:

  • 2021-10-26
  • 2022-12-23
  • 2021-11-19
  • 2021-07-11
  • 2021-09-14
  • 2021-12-08
  • 2021-08-26
  • 2021-06-21
猜你喜欢
  • 2022-12-23
  • 2021-06-13
  • 2021-04-01
  • 2022-12-23
  • 2022-02-10
  • 2021-08-23
相关资源
相似解决方案