Registry / data / libusb-package

libusb-package

JSON →
library1.0.30.0pypypi✓ verified 23d ago

libusb-package is a Python library that functions primarily as an installation vehicle for the libusb shared C libraries, making it easier to install tools and applications that require libusb, such as pyusb. It bundles the necessary libusb binaries for various platforms and architectures, simplifying deployment by avoiding manual libusb installation. The package is actively maintained, with version 1.0.26.3 being the latest, and receives updates to support new Python versions and upstream libusb releases.

pip install libusb-package
INSTALL
IMPORT
SIG · LIBUSB-PACKAGE
L
libusb-package
datapythonv1.0.30.0
Install
1.7s avg
Import
85ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0.30.0 · 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
installs and imports cleanly · install 0.0s · import 0.084s · 18.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.086s · 19MB
16MB installed
● package 16MB
Code
Verified usage

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

libusb_package
import libusb_package

This quickstart demonstrates how to import `libusb_package` and use its `find_library` function to provide a backend for `pyusb`, allowing `pyusb` to utilize the libusb shared library bundled within `libusb-package`. It then attempts to find a generic USB device (replace with your actual Vendor/Product ID).

import libusb_package import usb.core import usb.backend.libusb1 # Get a PyUSB backend using the bundled libusb library backend = usb.backend.libusb1.get_backend(find_library=libusb_package.find_library) # Use the backend to find USB devices (example with pyusb) dev = usb.core.find(idVendor=0xffff, idProduct=0xffff, backend=backend) if dev is None: print("Device not found. Make sure it's connected and drivers are installed (especially on Windows).") else: print(f"Found device: {dev.product} (Bus {dev.bus}, Address {dev.address})") # Further operations with 'dev' using pyusb
Debug
Known issues
breakingPython 3.6 support was officially dropped starting with `libusb-package` v1.0.26.1.
fix
Upgrade your Python environment to 3.7 or newer.
affects: >=1.0.26.1
gotchaOn Windows, `libusb-package` installs the `libusb` DLL, but it *does not* install the necessary device drivers (e.g., WinUSB or libusbK). Users must manually install these drivers for their specific USB devices, often using tools like Zadig. Without the correct driver, your Python application will not be able to access the USB device.
fix
Install the appropriate USB driver (e.g., WinUSB, libusbK) for your device using a tool like Zadig after installing `libusb-package`.
affects: All versions on Windows
gotchaIf `libusb-package` is installed from a source distribution and the underlying C `libusb` build fails (e.g., due to missing build tools), the Python package installation will still succeed but will result in an 'empty' `libusb-package` that does not contain the shared library. In such cases, `libusb_package.get_library_path()` will return `None`, and `find_library()` will fall back to `ctypes.util.find_library()` to search for a system-wide `libusb` installation.
fix
Ensure all necessary build dependencies (e.g., autoconf, automake, Visual Studio) are installed before attempting a source installation, or ensure a pre-built wheel is available for your platform and Python version.
affects: All versions, when installing from source without pre-built wheels
gotchaVersions of `libusb-package` prior to 1.0.24.1 had an issue with the `functools.lru_cache()` decorator that prevented it from working correctly on Python versions earlier than 3.9.
fix
Upgrade `libusb-package` to version 1.0.24.1 or newer, or ensure you are running Python 3.9+.
affects: <1.0.24.1
deprecatedThe internal usage of `importlib.resources` API was replaced in v1.0.26.2 due to deprecation. While this was an internal change, direct interaction with `libusb_package`'s resource loading mechanisms (if any existed in user code) might require review.
fix
No user-facing fix is typically required unless custom code was deeply coupled with `libusb_package`'s internal resource handling. Ensure you are on the latest version for internal compatibility.
affects: <1.0.26.2
Errors
Common errors & fixes
ValueError: No backend available
PyUSB, a common library for interacting with USB devices, cannot find the underlying libusb shared C library, which libusb-package is designed to provide.
fix
Ensure libusb-package is correctly installed via `pip install libusb-package`. If issues persist, explicitly configure PyUSB to use the backend provided by libusb-package by passing `backend=libusb_package.get_libusb1_backend()` to PyUSB functions like `usb.core.find()`.
ModuleNotFoundError: No module named 'usb'
The `pyusb` library, which provides the 'usb' module, is not installed. While libusb-package provides the C libraries, `pyusb` is the Python wrapper that exposes the functionality.
fix
Install the pyusb library using pip: `pip install pyusb`.
OSError: libusb-1.0.dll: cannot open shared object file: No such file or directory
The `libusb` shared library (e.g., `libusb-1.0.dll` on Windows, `libusb-1.0.so.0` on Linux) cannot be found by `libusb-package` or PyUSB. This can occur if `libusb-package` failed to correctly place the binaries during installation, if there's an architecture mismatch, or if necessary system-level development packages are missing for a source build.
fix
Reinstall `libusb-package` (`pip install libusb-package`) to ensure proper binary placement. On Windows, if automatic placement fails, manually copy the appropriate `libusb-1.0.dll` (from libusb's official binaries, matching your Python's architecture) to `C:\Windows\System32` (for 64-bit Python) or `C:\Windows\SysWOW64` (for 32-bit Python). On Linux, ensure the `libusb-1.0-0-dev` package (or equivalent for your distribution) is installed (e.g., `sudo apt-get install libusb-1.0-0-dev`).
libusb build fails when installing from a source distribution
When a pre-built wheel for `libusb-package` is not available for your specific platform and architecture, pip attempts to compile `libusb` from its source distribution, which requires specific system-level build tools that are often missing.
fix
Install the necessary build requirements for your operating system. For Linux and macOS, install `autoconf`, `automake`, `libtool`, and `m4`. For Windows, install Visual Studio 2019 (Community edition is sufficient). After installing these tools, retry `pip install libusb-package`.
Upgrade
Version history
1.0.30.0latest on PyPI · released Jun 30, 2026
Audit
Dependencies
pyusboptionallibusb-package is primarily designed to provide a backend for pyusb, allowing it to find and utilize the bundled libusb shared library.
autoconf, automake, libtool, m4optionalRequired for building libusb from source on Linux and macOS if a pre-built wheel is not available.
Visual Studio 2019 (or newer)optionalRequired for building libusb from source on Windows if a pre-built wheel is not available.
Agent activity
8 hits · last 30 days
node
6
Amazon
1
Resources
libusb-package — pip install libusb-package · libregistry