从dnspython导入时出错

时间:2016-01-14 11:46:01

标签: python

使用dnspython时出现以下错误消息。

>>> from dns import resolver
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/dns/resolver.py", line 32, in <module>
import dns.flags
File "/usr/local/lib/python3.4/dist-packages/dns/flags.py", line 51, in <module>
_by_value = dict([(y, x) for x, y in _by_text.iteritems()])
AttributeError: 'dict' object has no attribute 'iteritems'

有人知道如何修复它吗?我正在使用python 3.4。 dnspython的替代品也是受欢迎的答案。

1 个答案:

答案 0 :(得分:0)

库与python 2.7和3.x都不兼容。安装dnspython3应该按照reported bug

中的建议进行操作