pyshark icon indicating copy to clipboard operation
pyshark copied to clipboard

Runtime error when accessing a packet

Open afmurillo opened this issue 3 years ago • 1 comments

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:

image

afmurillo avatar May 25 '21 05:05 afmurillo

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.

adanilev avatar Oct 24 '21 06:10 adanilev