Language - Python
Get Started
With the Phidget22 Python library, it's easy to create Python applications that work with Phidget devices.
Python Libraries
pip Package
The Phidget22 Python library is available as a pip package. Most development environments provide built-in tools to manage packages. View the Development Environment Configuration section below for examples.
macOS Considerations
Phidget devices running a HID USB stack require the installation of the macOS libraries or the standalone Phidget Control Panel (download here).
To determine what USB stack your Phidget device is on, navigate to the product page and then to the specification tab, and look for the USB Stack specification. If you are using a VINT device, navigate to the product page for the VINT Hub you are using.
Linux Considerations
Linux restricts access to USB devices to the root user. To run your Python application as a regular user, you'll need to set up udev rules on your system.
Source Files
The Phidget22 Python library source files are available here.
Development Environment Configuration
Most development environments provide built-in tools to manage Python interpreters, packages, and virtual environments. See the examples below for more information.
Installing a Python Interpreter
If you don't already have a Python interpreter installed, you can download and install one from python.org or through package managers like Homebrew.
Visual Studio Code
PyCharm
Example Code
Navigate to our Code Sample Generator to view and download code samples that are tailored to your specific device.
Phidget Programming Basics
To learn more about the structure of the example code, visit our Phidget Programming Basics guide.