报错内容:
pyshark.tshark.tshark.TSharkNotFoundException: TShark not found. Try adding its location to the configuration file. Searched these paths: ['C:\\Program Files\\Wireshark\\tshark.exe', 'C:\\Program Files (x86)\\Wireshark\\tshark.exe', 'C:\\Program Files\\Wireshark\\tshark.exe']
出现该报错的主要原因是因为没有找到tshark.exe,没找到这个是因为你的wireshark没有安装在默认路径,如果重新安装比较麻烦,我们可以去修改config.ini中的tshark.exe的路径。
config.ini路径在python安装路径的\Lib\site-packages\pyshark中
修改前,我们先把原版备份一下,以备不时之需!
原版:
[tshark]
# Specify the path to the tshark executable.
#

本文介绍了解决PyShark在使用过程中找不到TShark路径的问题,主要原因是Wireshark未安装在默认路径。通过修改Python安装路径下Libsite-packagespyshark中的config.ini文件来指定正确的TShark路径。
最低0.47元/天 解锁文章
4990

被折叠的 条评论
为什么被折叠?



