pypcap is a Python interface to the `libpcap` C library, enabling programmatic packet capture and analysis. It provides access to network devices and allows reading packets from live captures or pcap dump files. The current version is 1.3.0. Releases are infrequent but address Python compatibility and underlying `libpcap` features.
pip install pypcapVerified import paths — ran on the pinned version, not inferred.
This quickstart captures packets on a default or specified network interface. It includes error handling for common issues like permissions and device availability. Run with `sudo` on Linux/macOS for best results.
Install `libpcap-dev` on Debian/Ubuntu (`sudo apt-get install libpcap-dev`), `libpcap-devel` on RHEL/CentOS (`sudo yum install libpcap-devel`), or `libpcap` on macOS (`brew install libpcap`).
Run your Python script with `sudo` (e.g., `sudo python your_script.py`) or configure `setcap` on Linux to grant `cap_net_raw,cap_net_admin` capabilities to your Python executable.
For Python 3 projects, ensure `pypcap` is version 1.2.0 or higher. If you must use Python 2, ensure `pypcap` is below 1.2.0.
Upgrade `pypcap` to version 1.2.0 or higher to ensure correct and reliable packet iteration behavior.
No dependency data recorded yet.