pyshark.tshark.tshark.TSharkNotFoundException: 未找到 TShark

pyshark.tshark.tshark.TSharkNotFoundException: TShark not found

我正在尝试 运行 在 MACOX Catlina 上使用 pyshark 下面的代码,当我 运行 它时,我得到以下异常(另外我 运行 下面的程序使用 sudo ,以防万一它是由于权限问题,但给我同样的错误)

    "Searched these paths: {}".format(possible_paths)
pyshark.tshark.tshark.TSharkNotFoundException: TShark not found. Try adding its location to the configuration file. Searched these paths: ['C:\Program Files\Wireshark\dumpcap.exe', '/usr/local/bin/dumpcap', '/usr/bin/dumpcap', '/bin/dumpcap', '/usr/sbin/dumpcap', '/sbin/dumpcap', '/opt/X11/bin/dumpcap']
import pyshark

class SniffPacket(object):
    
    def __init__(self):
        self.sniff()
    
    
    def sniff(self):
        capture = pyshark.LiveCapture(interface='en0')
        capture.sniff(timeout=10)
            
if __name__ == '__main__':
    s = SniffPacket() 

我已经安装了 wireshark。任何帮助表示赞赏。是因为 pyshark 在 Mac 上不起作用吗?

打开config.ini文件并将tshark路径更改为您的tshark.exe所在的路径。 (为 Windows 工作) 如果这不起作用,请尝试将 dumpcap 路径也更改为存储 dumpcap.exe 的位置。