Registry / http-networking / pyftdi

pyftdi

JSON →
library0.57.2pypypi✓ verified 26d ago

pyftdi is a pure Python driver for FTDI devices, providing access to their various functionalities including USB-to-serial, SPI, I2C, and GPIO. It acts as a wrapper around the `libftdi` C library, enabling cross-platform control of FTDI-based hardware. The current version is 0.57.1, with an active development cadence supporting recent Python versions.

pip install pyftdi
INSTALL
IMPORT
SIG · PYFTDI
P
pyftdi
http-networkingpythonv0.57.2
Install
1.7s avg
Import
53ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.57.2 · 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.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.055s · 19.8MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 1.7s · import 0.051s · 20MB
18MB installed
● package 18MB
Code
Verified usage

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

Ftdi
✓ from pyftdi.ftdi import Ftdi
SpiController
✓ from pyftdi.spi import SpiController
I2cController
✓ from pyftdi.i2c import I2cController

This quickstart code demonstrates how to scan and list all detected FTDI devices connected to your system. It is a common first step to verify the `pyftdi` installation and device connectivity without requiring specific device URLs or complex operations. It relies on the underlying `libftdi` C library.

from pyftdi.ftdi import Ftdi def list_ftdi_devices(): """ Scans and lists available FTDI devices. Requires 'libftdi' to be installed on the system and appropriate USB permissions. """ print("Scanning for FTDI devices...") try: # Ftdi.show_devices() prints detected devices to stdout Ftdi.show_devices() print("\nIf no devices are listed, ensure they are connected,") print("libftdi is installed, and USB permissions are correct.") except Exception as e: print(f"Error scanning for devices: {e}") print("Ensure 'libftdi' is installed and USB permissions are set correctly.") if __name__ == "__main__": list_ftdi_devices()
pyftdi --version
Debug
Known issues
gotchapyftdi requires the `libftdi` C library to be installed on the system. `pip install pyftdi` only installs the Python wrapper, not the underlying C library. Without `libftdi`, pyftdi will not function.
fix
Install `libftdi` via your system's package manager (e.g., `sudo apt-get install libftdi1-dev` on Debian/Ubuntu, `brew install libftdi` on macOS) or build from source.
affects: All versions
gotchaOn Linux and macOS, accessing USB devices directly often requires specific user permissions (e.g., udev rules). Without these permissions, pyftdi may fail to detect or interact with FTDI devices.
fix
Create appropriate udev rules (Linux) or ensure the user has permission to access USB devices. Consult `libusb` or `libftdi` documentation for detailed setup. On Linux, temporarily running with `sudo` can confirm permission issues, but proper udev rules are recommended.
affects: All versions
gotchaOn Windows, pyftdi (via libusb) may conflict with standard FTDI drivers (e.g., VCP, D2XX). You might need to replace the standard drivers with WinUSB (using tools like Zadig) for pyftdi to detect the device.
fix
Use a tool like Zadig to install the WinUSB driver for your FTDI device. Be aware this may prevent other applications that rely on the standard FTDI drivers from working.
affects: All versions
breakingSupport for Python 3.8 and older versions has been deprecated and removed. Running pyftdi on Python 3.8 or earlier will result in errors or installation failure due to `Requires-Python` metadata.
fix
Upgrade your Python environment to Python 3.9 or newer. The current recommended minimum version is Python 3.9.
affects: >=0.56.0
Errors
Common errors & fixes
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)
This error occurs when the current user lacks the necessary permissions to access the USB FTDI device, or another driver (like the default VCOM driver on Windows/macOS) is already claiming the device.
fix
On Linux, configure udev rules to grant access to the USB device (e.g., `SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", MODE="0666"`, then `sudo udevadm control --reload-rules && sudo udevadm trigger`). On macOS, unload conflicting kernel extensions (e.g., `sudo kextunload -v -bundle com.apple.driver.AppleUSBFTDI` for older macOS versions). On Windows, ensure the correct libusb-based driver (e.g., `libusbK`) is installed using a tool like Zadig, replacing the default FTDI VCOM driver.
Error: No backend available
This error indicates that the underlying `libusb` native library, which `pyftdi` relies on via `PyUSB`, cannot be found or loaded on your system.
fix
Ensure that `libusb` is correctly installed and accessible on your system. On Linux, this usually means `libusb-1.0-0-dev` or similar packages. On Windows, copy `libusb-1.0.dll` to a location where Python can find it, such as `C:\Windows\System32` or the Python executable directory, after installing it via Zadig. You might also need to set `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS) if `libusb` is in a non-standard location.
pyftdi.usbtools.UsbToolsError: No USB device matches URL ftdi://
This error means that `pyftdi` could not find any FTDI device matching the provided URL scheme, or no FTDI devices were detected at all.
fix
Verify the FTDI device is correctly connected and powered. Use the `ftdi_urls.py` script (shipped with `pyftdi`) to list available devices and their corresponding URLs. Ensure the URL used in your code precisely matches one of the detected devices (e.g., `ftdi:///1` for the first detected device, or `ftdi://ftdi:0x6014/1` using VID/PID). Check for other processes or drivers that might be claiming the device, preventing `pyftdi` from seeing it.
pyftdi.ftdi.FtdiError: UsbError: [Errno 16] Resource busy
This error occurs when the FTDI USB device is already opened or claimed by another application, process, or a conflicting driver, preventing `pyftdi` from accessing it.
fix
Close any other applications that might be using the FTDI device (e.g., serial terminals, other Python scripts). On some operating systems, you might need to identify and terminate processes holding the USB resource. If using virtual COM port drivers, ensure they are unloaded or replaced with a `libusb`-compatible driver. For multiprocessing scenarios, ensure that only one process attempts to open and control the device at any given time.
Upgrade
Version history
0.57.2latest on PyPI · released Jun 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
16
Resources
pyftdi — pip install pyftdi · libregistry