ver.2 PyGreSQL错误:来自_pg import * ImportError:DLL加载失败:找不到指定的模块
我遇到了与此处讨论的问题相同的问题,但是我不敢评论评论,所以我开始了新的问题。
我以PATH方式访问libpq.dll(C:\ PostgreSql \ lib),但无法解决此问题。
使用Python 2.7.9 32位,PostgreSQL 8.4,Win 8
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import pg
File "C:\Python27\lib\site-packages\pg.py", line 21, in <module>
from _pg import *
ImportError: DLL load failed: The specified module could not be found.
-
我在上也面临着同样的问题
Win 8
。第一次安装PostgreSQL
“ C:\ Program
Files”,并且将环境设置PATH
为指向PostgreSQL文件夹。我怀疑“ C:\ Program Files”文件夹的权限问题。我可以按照以下步骤解决此问题。
- 卸载PostgreSQL
- 在 “ C:\ PostgreSQL”中 重新安装PostgreSQL 注意这次我没有将PostgreSQL安装到“ C:\ Program Files”文件夹中
- 设置环境
PATH
C:\PostgreSQL\9.4;C:\PostgreSQL\9.4\bin
- 同时确保
_pg.pyd
存在于C:\Python27\Lib\site-packages