Registry / http-networking / netifaces-plus

netifaces-plus

JSON →
library0.12.5pypypi✓ verified 84d ago

A portable library to retrieve network interface information (IP addresses, MAC addresses, gateways, etc.) on Unix, Windows, and macOS. Version 0.12.5 supports Python >=3.6. Fork of the unmaintained netifaces with modern Python support and additional features. Released irregularly.

pip install netifaces-plus
INSTALL
IMPORT
SIG · NETIFACES-PLUS
N
netifaces-plus
http-networkingpythonv0.12.5
Install
1.6s avg
Import
Disk
16MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.12.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

netifaces
import netifaces
import netifaces_plus
The library name in PyPI is 'netifaces-plus' but the import package is 'netifaces'. Do not use the hyphenated name.
interfaces
netifaces.interfaces()
netifaces.networks()
The function to list interface names is `interfaces()`, not `networks()`.
gateways
netifaces.gateways()
netifaces.default_gateway()
`gateways()` is a top-level function returning all gateway info. There is no `default_gateway()`.

Basic usage: list interfaces, get addresses for first interface, and show gateways.

import netifaces # List all network interface names ifaces = netifaces.interfaces() print('Interfaces:', ifaces) # Get addresses for a specific interface (e.g., 'eth0' or 'en0') if ifaces: iface = ifaces[0] addrs = netifaces.ifaddresses(iface) print(f'Addresses for {iface}:', addrs) # Get default gateways print('Gateways:', netifaces.gateways())
Debug
Known issues
gotchaThe PyPI package name is 'netifaces-plus' but the Python import is 'netifaces'. This often confuses users who try 'import netifaces_plus'.
fix
Use 'import netifaces'.
affects: all
gotchaOn some platforms (e.g., Windows), 'ifaddresses(MY_IFACE)' may return empty or partial data if the interface is down or not fully initialized. Always handle missing keys.
fix
Check if address family exists: `netifaces.AF_INET in addrs`.
affects: all
breakingIn version 0.12.4, the library dropped support for Python 3.5 and below. Users on older Python must pin to an older release.
fix
Upgrade Python to 3.6+ or use 'pip install netifaces-plus<0.12.4'.
affects: >=0.12.4
gotchaThe 'gateways()' function returns a dict where keys are address families (e.g., AF_INET, AF_INET6) and values are lists. The default gateway is the first element of the list, not a separate key.
fix
Access default IPv4 gateway with `netifaces.gateways()['default'][netifaces.AF_INET]`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'netifaces_plus'
User tried to import the package with the PyPI name (netifaces-plus) as the module name.
fix
Use 'import netifaces' instead of 'import netifaces_plus'.
AttributeError: module 'netifaces' has no attribute 'interfaces'
The module might not be the real netifaces-plus (perhaps a stale or different package).
fix
Ensure you installed netifaces-plus (not netifaces) and check the version: `pip show netifaces-plus`.
KeyError: 2 (or AF_INET not found)
The interface does not have an IPv4 address (e.g., no IP assigned).
fix
Check with `if netifaces.AF_INET in addrs` before accessing addrs[netifaces.AF_INET].
Upgrade
Version history
0.12.5latest on PyPI · released Nov 1, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
netifaces-plus — pip install netifaces-plus · libregistry