我想知道周围的人是否可能知道导致此问题的原因。在运行使用pyshark库的python脚本时,我在OSX High Sierra上始终收到此错误。
我正在跑步
错误:
/usr/local/lib/python3.7/site-packages/pyshark-0.4.1-py3.7.egg/pyshark/capture/capture.py:230: RuntimeWarning: coroutine 'wait_for' was never awaited
self.eventloop.run_until_complete(self._cleanup_subprocess(tshark_process))
/usr/local/lib/python3.7/site-packages/pyshark-0.4.1-py3.7.egg/pyshark/capture/capture.py:230: RuntimeWarning: coroutine 'Process.wait' was never awaited
self.eventloop.run_until_complete(self._cleanup_subprocess(tshark_process))
我的代码:
#!/usr/bin/env python3
import pyshark
def capture(iface, tout):
cap = pyshark.LiveCapture(interface=iface);
cap.set_debug()
cap.sniff(timeout=10)
for packet in cap.sniff_continuously(packet_count=5):
print('Just arrived:', packet)
capture('en7', 50)
使用sudo执行脚本不起作用。而且我能够在不使用sudo命令的情况下运行TShark,所以我认为这也不应该是一个问题。我还启动了XCode,以检查是否需要提交任何协议或其他东西,不是这种情况。