官方文档https://pypcap.readthedocs.io/en/latest/index.html
有说明windows下的安装
Windows notes
WinPcap has compatibility issues with Windows 10, therefore it’s recommended to use Npcap (Nmap’s packet sniffing library for Windows, based on the WinPcap/Libpcap libraries, but with improved speed, portability, security, and efficiency). Please enable WinPcap API-compatible mode during the library installation.
第1步,下载并安装npcap installerhttps://nmap.org/npcap/
可以直接跳到第7步先试一下
第2步,下载npcap sdk,然后把文件命名为wpdpack,放到python安装路径下的include目录下
第3步,pip install pypcap
,报错需要vc 14.0+的环境,从它给的链接下载