Python 3.x OSX PyShark:RuntimeWarning:coroutine';等待&x27;从来没有等待过
我想知道这里是否有人知道这个问题的原因。我在OSX High Sierra上不断遇到这个错误,同时运行使用pyshark库的python脚本 我在跑步Python 3.x OSX PyShark:RuntimeWarning:coroutine';等待&x27;从来没有等待过,python-3.x,macos,macos-high-sierra,tshark,pyshark,Python 3.x,Macos,Macos High Sierra,Tshark,Pyshark,我想知道这里是否有人知道这个问题的原因。我在OSX High Sierra上不断遇到这个错误,同时运行使用pyshark库的python脚本 我在跑步 Tshark 2.6.2 Python 3.7.0 PyShark 0.4.1 错误: /usr/local/lib/python3.7/site-packages/pyshark-0.4.1-py3.7.egg/pyshark/capture/capture.py:230: RuntimeWarning: coroutine 'wait_f
- Tshark 2.6.2
- Python 3.7.0
- PyShark 0.4.1
/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来检查我是否需要提交任何协议或其他东西,但事实并非如此