AttributeError: module 'itertools' has no attribute 'izip'

诚诚哥哥 Python 操作数据库—— ... 最后由 上海小胖 于03月19日回复

  • 1 回答
  • 331 浏览

在载入torndb模块后,无论是使用get方法还是用query方法均出现

Traceback (most recent call last):

  File "D:PycharmProjectsOnmyoji_searchtest_connect_read.py", line 62, in <module>

    row = db2.get(sql)

  File "C:UsersAdministratorAppDataLocalProgramsPythonPython35libsite-packagestorndb.py", line 148, in get

    rows = self.query(query, *parameters, **kwparameters)

  File "C:UsersAdministratorAppDataLocalProgramsPythonPython35libsite-packagestorndb.py", line 138, in query

    return [Row(itertools.izip(column_names, row)) for row in cursor]

  File "C:UsersAdministratorAppDataLocalProgramsPythonPython35libsite-packagestorndb.py", line 138, in <listcomp>

    return [Row(itertools.izip(column_names, row)) for row in cursor]

AttributeError: module 'itertools' has no attribute 'izip'

我使用的是python3.5,万望解决,感谢感谢~~~