{"id":5394,"library":"pyftdi","title":"pyftdi: FTDI Device Driver","description":"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.","status":"active","version":"0.57.1","language":"python","source_language":"en","source_url":"https://github.com/eblot/pyftdi","tags":["hardware","ftdi","usb","spi","i2c","gpio","driver"],"install":[{"cmd":"pip install pyftdi","lang":"bash","label":"Install core library"},{"cmd":"pip install pyftdi[pyusb]","lang":"bash","label":"Install with PyUSB support (optional)"}],"dependencies":[],"imports":[{"symbol":"Ftdi","correct":"from pyftdi.ftdi import Ftdi"},{"symbol":"SpiController","correct":"from pyftdi.spi import SpiController"},{"symbol":"I2cController","correct":"from pyftdi.i2c import I2cController"}],"quickstart":{"code":"from pyftdi.ftdi import Ftdi\n\ndef list_ftdi_devices():\n    \"\"\"\n    Scans and lists available FTDI devices.\n    Requires 'libftdi' to be installed on the system and appropriate\n    USB permissions.\n    \"\"\"\n    print(\"Scanning for FTDI devices...\")\n    try:\n        # Ftdi.show_devices() prints detected devices to stdout\n        Ftdi.show_devices()\n        print(\"\\nIf no devices are listed, ensure they are connected,\")\n        print(\"libftdi is installed, and USB permissions are correct.\")\n    except Exception as e:\n        print(f\"Error scanning for devices: {e}\")\n        print(\"Ensure 'libftdi' is installed and USB permissions are set correctly.\")\n\nif __name__ == \"__main__\":\n    list_ftdi_devices()","lang":"python","description":"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."},"warnings":[{"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.","message":"pyftdi 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"On 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"On 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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade your Python environment to Python 3.9 or newer. The current recommended minimum version is Python 3.9.","message":"Support 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.","severity":"breaking","affected_versions":">=0.56.0"}],"env_vars":null,"search_vec":"'0.57.1':53 'access':15 'act':30 'activ':56 'around':34 'base':47 'c':37 'cadenc':58 'control':43 'cross':41 'cross-platform':40 'current':50 'develop':57 'devic':3,13 'driver':4,10,69 'enabl':39 'ftdi':2,12,46,64 'ftdi-bas':45 'function':19 'gpio':28,68 'hardwar':48,63 'i2c':26,67 'includ':20 'libftdi':36 'librari':38 'platform':42 'provid':14 'pure':8 'pyftdi':1,5 'python':9,61 'recent':60 'serial':24 'spi':25,66 'support':59 'usb':22,65 'usb-to-seri':21 'various':18 'version':51,62 'wrapper':33","created_at":"2026-04-14T01:31:58.682751+00:00","updated_at":"2026-04-16T18:27:17.331225+00:00","problems":[{"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.","cause":"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.","error":"usb.core.USBError: [Errno 13] Access denied (insufficient permissions)"},{"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.","cause":"This error indicates that the underlying `libusb` native library, which `pyftdi` relies on via `PyUSB`, cannot be found or loaded on your system.","error":"Error: No backend available"},{"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.","cause":"This error means that `pyftdi` could not find any FTDI device matching the provided URL scheme, or no FTDI devices were detected at all.","error":"pyftdi.usbtools.UsbToolsError: No USB device matches URL ftdi://"},{"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.","cause":"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.","error":"pyftdi.ftdi.FtdiError: UsbError: [Errno 16] Resource busy"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.57.2","cli_name":"pyftdi","cli_version":"sh: 1: pyftdi: not found","type":"library","homepage":"https://eblot.github.io/pyftdi/","github":"http://github.com/eblot/pyftdi","docs":null,"changelog":null,"pypi":"https://pypi.org/project/pyftdi/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}