Phidgets Stepper Motor controller install for Python

Related: Phidgets Matlab install


  1. Phidgets prereqs are distinct for Linux, Mac and Windows.

### Linux

   apt install autoconf gcc libusb-1.0-0-dev make
   

### Mac

   brew install gcc
   

### Windows

Install MinGW-W64 compiler (GCC, GFortran) using options:

ArchitectureThreadsException
x86_64posixseh
  1. Download Phidgets Libraries
  2. Install Phidgets Libraries. For Mac and Windows just run the installer. For Linux:
   tar xf libphidget22*.tar.gz
   cd libphidget22*

   ./configure
   make
   make install
   
  1. Download Phidgets Python API, extract and install Phidgets Python API with
   python -m pip install -e .
   

Note that currently PyPi has Phidgets 2.1.x, which is obsolete. 5. reboot

Examples

Phidgets Python Examples

Notes

Phidgets Python Install

Phidgets Python Troubleshooting

THESE COMMENTS ARE FOR OBSOLETE Phidgets 2.1.x. I have not yet updated the text below for Phidgets 2.2.x.

RuntimeError: Platform not supported

The Python Phidgets 2.1.8 library was last updated in 2014, and so it’s a little out of date. For Linux systems, fix this by editing in the following places under your Python install’s site-packages/Phidgets/

  • PhidgetLibrary.py line 23, change from sys.platform == 'linux2': to
  elif 'linux' in sys.platform:
  
  • Devices/Stepper.py line 61, change the end from or sys.platform == 'linux2': to
  or 'linux' in sys.platform:
  
  • PhidgetException.py line 32, change from sys.platform == 'linux2': to
  elif 'linux' in sys.platform:
  
  • For Linux only, copy udev rule so that you don’t have to use sudo for all programs using the Phidget controllers:
  cp udev/99-phidgets.rules /etc/udev/rules.d/