免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 9498 | 回复: 4
打印 上一主题 下一主题

import DB2 报错。 line 12, in <module> import _db2 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-21 11:09 |显示全部楼层 |倒序浏览
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************
   
IDLE 1.2.4      
>>> import DB2

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import DB2
  File "D:\Python25\Lib\site-packages\DB2.py", line 12, in <module>
    import _db2
ImportError: DLL load failed: The specified module could not be found.

>>>

安装了pydb2之后,import DB2时却报了上面的错。
这是怎么回事。请高手不吝赐教。

论坛徽章:
0
2 [报告]
发表于 2010-05-21 11:34 |显示全部楼层
回复 2# luffy.deng

我刚接触python。你刚才说的那个module我之前不知道。这里先谢谢了。
pydb2的问题我还是想搞清楚。为什么我安装了,却不能用。郁闷。

论坛徽章:
0
3 [报告]
发表于 2010-05-21 13:19 |显示全部楼层
谢谢大家的回复。我是下载的是exe文件。直接安装的。

安装的module在D:\Python25\Lib\site-packages。在这个目录下有几个文件是 _db2.pyd, DB2.py,DB2.pyc, DB2.pyo。

DB2.py中第12行是 import _db

论坛徽章:
0
4 [报告]
发表于 2010-05-21 13:30 |显示全部楼层
非常感谢大家的帮助。

特别感谢windwiny,按照你说的方法,把IBM\SQLLIB\BIN 加到PATH中就可以了。

再次感谢大家。

论坛徽章:
0
5 [报告]
发表于 2010-05-21 14:02 |显示全部楼层
回复 9# to407


    谢谢你。已经解决了。
就是db2的dll的路径没有加到path中。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP