{"id":23964,"library":"libpci","title":"libpci","description":"Pure-Python, high-level bindings to libpci, providing access to PCI device information. Current version 0.2, low release cadence (last release 2016). Actively maintained? Possibly minimal.","status":"maintenance","version":"0.2","language":"python","source_language":"en","source_url":"https://github.com/zyga/libpci","tags":["pci","hardware","system","bindings"],"install":[{"cmd":"pip install libpci","lang":"bash","label":"PyPI"}],"dependencies":[],"imports":[{"note":"Wildcard imports discouraged; namespace pollution.","wrong":"from pci import *","symbol":"pci","correct":"import pci"},{"note":"Common class for enumerating devices.","wrong":"","symbol":"PCIDevices","correct":"from pci import PCIDevices"}],"quickstart":{"code":"import pci\n\n# Enumerate all PCI devices\ndevices = pci.PCIDevices()\nfor dev in devices:\n    print(dev.address, dev.vendor_name, dev.device_name)","lang":"python","description":"List all PCI devices with vendor and device names."},"warnings":[{"fix":"Install system package: sudo apt-get install libpci-dev","message":"libpci requires libpci (or libpci-dev) system library installed. On Debian/Ubuntu: sudo apt install libpci-dev. Otherwise ImportError about missing shared library.","severity":"gotcha","affected_versions":"all"},{"fix":"Run script as root or use sudo.","message":"Initialization might require root privileges to read PCI config space. Use 'pci.PCIDevices()' may fail with PermissionError if /sys/bus/pci/devices is read-only for non-root.","severity":"gotcha","affected_versions":"all"},{"fix":"Switch to pypci: pip install pypci","message":"libpci 0.2 is last release; no updates since 2016. Consider using 'pypci' for more modern API.","severity":"deprecated","affected_versions":"0.2"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install libpci3 or libpci-dev package (e.g., sudo apt install libpci-dev).","cause":"System library libpci not installed or not found.","error":"ImportError: libpci.so.3: cannot open shared object file: No such file or directory"},{"fix":"Run script with sudo: sudo python script.py","cause":"Non-root user cannot read PCI device files.","error":"PermissionError: [Errno 13] Permission denied: '/sys/bus/pci/devices/...'"},{"fix":"Verify installation: pip install --upgrade libpci","cause":"Old version or incorrect installation; PCIDevices is class in pci module.","error":"AttributeError: module 'pci' has no attribute 'PCIDevices'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}