Raspberry Pi and LabJack | LabJack
Monday June 1st 2020
Support: LabJack engineers available through email and chat.
Shipping: We are processing and shipping all orders.
Stock: 51 of 56 products are in stock. More details.
Supply Chain: Minor impacts. More details.

Raspberry Pi and LabJack

3 posts / 0 new
Last post
andrew@ajlutley.co.uk's picture
Raspberry Pi and LabJack

I am trying to read the analog input from AIN0 on a LabJack U3-HV on a Raspbery Pi.

I have installed exodriver and LabJackPython on the Pi.

When I use the Pi Terminal to run the ain0bits function, it returns a sensible reading.  However, when I build that into a Python program and run it, I get an error message:

“ImportError: cannot import name ‘Device’” referencing line 30 in u3.py.

I get the same error when I try to run the u3allio.py program in LabJackPython/Examples.

I am new to Python and the Pi, so have probably missed out a crucial step.  Any suggestions would be welcome.


LabJack Support
LabJack Support's picture
The Device class is in

The Device class is in LabJackPython.py, and it looks like u3.py can't find it.

For the standard Python installation instructions, refer to the README. Using the setup.py file for installation installs to Python on your system.

If you are building into a program, for the U3 make sure it includes the u3.py, LabJackPython.py and Modbus.py files in the same directory.

Regarding the examples, if you copied u3.py to the Examples directory, either delete u3.py so the Python installation of the LabJackPython files are used, or have u3.py, LabJackPython.py and Modbus.py in the directory.


andrew@ajlutley.co.uk's picture


Many thanks.

I didn't have all of those files in te same folder.  Now that I have copied them there, both my program and u3allio.py now work without the error mesage I was getting before.