Pythonping is an active Python library (current version 1.1.4) that provides a simple and modular way to send ICMP probes to remote devices, similar to the `ping` utility available in most operating systems. It allows developers to perform network reachability tests directly from Python scripts, with options to customize packet size, timeout, interval, and collect detailed response statistics. The library maintains a steady release cadence with improvements and bug fixes.
pip install pythonpingVerified import paths — ran on the pinned version, not inferred.
This quickstart pings Google's public DNS server (8.8.8.8) four times, prints detailed output for each response, and then summarizes the session with statistics like packet loss and round-trip times. It includes error handling for common permission issues.
Update your `ping()` calls to use keyword arguments for `payload`, `sweep_start`, and `sweep_end` (e.g., `ping('host', payload=b'data')` instead of `ping('host', b'data')`).Run your Python script with `sudo python your_script.py` on Linux/macOS, or execute it from a command prompt/terminal run as Administrator on Windows.
Upgrade to version 1.1.4 or higher to use `count` values beyond 16-bit. If on an older version and unable to upgrade, limit `count` to 65535 or less.
Upgrade to version 1.0.14 or newer to resolve the intermittent threaded usage failures. If upgrading is not possible, implement robust error handling around `ping` calls in threads.
Run your Python script with `sudo python your_script.py` on Linux/macOS, or execute it from an elevated command prompt/terminal (Run as Administrator) on Windows.
Install the library using `pip install pythonping`. If using virtual environments, ensure the correct environment is activated. If multiple Python versions are installed, use `python3 -m pip install pythonping` and `python3 your_script.py` to ensure consistency.
Upgrade the library to version 1.0.15 or newer to access `packet_loss`, or to 1.1.3 or newer for `stats_packets_sent`, `stats_lost_ratio`, etc. using `pip install --upgrade pythonping`.
Ensure you are running your script with a Python 3 interpreter (e.g., `python3 your_script.py`). Pythonping does not support Python 2.x.
No dependency data recorded yet.