导入adodbapi时出错:“没有这样的密钥......”

时间:2016-01-28 15:11:40

标签: python adodbapi

我非常喜欢使用adodbapi模块,但我无法导入它。 Python 3.2 32位的最新版本似乎有语法错误:

Traceback (most recent call last):
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.4\helpers\pydev\pydevd.py", line 2358, in <module>
    globals = debugger.run(setup['file'], None, None, is_module)
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.4\helpers\pydev\pydevd.py", line 1778, in run
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 4.5.4\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc) 
  File "C:/Customers/Calvert/Scripts/test_adodb.py", line 1, in <module>
    import adodbapi
  File "C:\Python32\lib\site-packages\adodbapi\__init__.py", line 16, in <module>
    from .apibase import apilevel, threadsafety, paramstyle
  File "C:\Python32\lib\site-packages\adodbapi\apibase.py", line 495
    raise er,'No such key as "%s" in %s'%(repr(key),self.__repr__()),tr

我需要做些什么来解决这个问题?这个Python 2语法是在为Python 3设计的文件中吗?我从SourceForge下载的文件名是pywin32-220.win32-py3.2.exe,日期为1/11/16。

1 个答案:

答案 0 :(得分:0)

显然,我是对的。这个模块标记为python 3.2,包含Python 2代码。我在它上面运行了2to3,语法错误消失了。