((win10)Python 3.6-错误Pyshark capture.sniff()

问题描述 投票:0回答:1

这是我的代码:

import pyshark
cap = pyshark.LiveCapture(output_file='newOutput')

错误:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files\Python36\lib\site-packages\pyshark\capture\live_capture.py", line 57, in __init__
    self.interfaces = get_tshark_interfaces(tshark_path)
  File "C:\Program Files\Python36\lib\site-packages\pyshark\tshark\tshark.py", line 138, in get_tshark_interfaces
    parameters = [get_process_path(tshark_path), '-D']
  File "C:\Program Files\Python36\lib\site-packages\pyshark\tshark\tshark.py", line 98, in get_process_path
    'Search these paths: {}'.format(possible_paths)
pyshark.tshark.tshark.TSharkNotFoundException: TShark not found. Try adding its location to the configuration file. Search these paths: ['C:\\Program Files\\Wireshark\\tshark.exe', 'C:\\Program Files (x86)\\Wireshark\\tshark.exe', 'C:\\Program Files\\Wireshark\\tshark.exe']

我正在运行带有python 3.6的Windows 10计算机。我已经安装了wireshark和tshark(但是它不在默认文件夹中;我也已经在Windows的系统变量中记录了它们的路径)

python-3.x windows-10 tshark pyshark
1个回答
0
投票

sudo apt-get install tshark为Ubuntu用户完成了工作,因为您是Windows用户,所以应该安装tshark软件包。

© www.soinside.com 2019 - 2024. All rights reserved.