当我只使用这一行代码时:
import dpkt
我收到此错误:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import dpkt
File "C:\Python27\lib\dpkt\__init__.py", line 24, in <module>
import ethernet
File "C:\Python27\lib\dpkt\ethernet.py", line 128, in <module>
__load_types()
File "C:\Python27\lib\dpkt\ethernet.py", line 122, in __load_types
mod = __import__(modname, g)
File "C:\Python27\lib\dpkt\ip6.py", line 101, in <module>
import ip
File "C:\Python27\lib\dpkt\ip.py", line 258, in <module>
__load_protos()
File "C:\Python27\lib\dpkt\ip.py", line 255, in __load_protos
IP.set_proto(v, getattr(mod, name.upper()))
AttributeError: 'module' object has no attribute 'VISA'
可能是什么问题?
答案 0 :(得分:0)
dpkt问题页面有针对此问题的补丁。 https://code.google.com/p/dpkt/issues/detail?id=34处的第二个补丁修复了导入问题。