pyshark
pyshark copied to clipboard
Runtime error when accessing a packet
Hello, I'm just testing the library as it looked promising. Nevertheless, I have a RuntimeError just after opening a capture file and trying to access a packet (it's an ARP packet)
I attempted this:
import pyshark cap = pyshark.FileCapture(input_file='plc1-eth0.pcap') cap[0]
This is the error:
i just resolved this with nest_asyncio like so:
import nest_asyncio
import pyshark
nest_asyncio.apply()
cap = pyshark.FileCapture('/path/to/my.pcap')
print(cap[0])
seems this has to do with the way asyncio
works in jupyter.. check out the link for more details.