ImportError: No module named 'Phidget22'

Supporting 2.6 and up
DamianBusz
Phidgetsian
Posts: 6
Joined: Mon Jul 24, 2017 5:52 am
Contact:

ImportError: No module named 'Phidget22'

Post by DamianBusz »

Hello there!,
I have installed libraries thrue make and config and everything went succesful but somehow my python does not find Phidget22 lib.

I do use Raspberry pi 3
User avatar
mparadis
Site Admin
Posts: 959
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: ImportError: No module named 'Phidget22'

Post by mparadis »

In addition to the linux drivers, you also need the Phidget22 python module, found here.

Follow the instructions on the python page for more details.
dmar
Fresh meat
Posts: 2
Joined: Sun Aug 05, 2018 6:00 pm
Contact:

Re: ImportError: No module named 'Phidget22'

Post by dmar »

I'm having the same problem. I have followed the instructions above (downloaded the latest python module, and have run 'sudo python setup.py install' successfully) but still receive this error when I run 'from Phidget22.Devices.Stepper import *' in my python script. I'm new to linux (rasparian) so am now out of troubleshooting ideas. What am I missing?
mwulff2125
Phidgetsian
Posts: 5
Joined: Thu Oct 10, 2019 5:08 am
Contact:

Re: ImportError: No module named 'Phidget22'

Post by mwulff2125 »

Did you figure out this error? I am having the same issue. Any help would be appreciated.
Powergrid
Fresh meat
Posts: 4
Joined: Mon Jul 25, 2011 11:04 am
Contact:

Re: ImportError: No module named 'Phidget22'

Post by Powergrid »

Hi;

I am also having the same issue. I'm running an Rpi 3 with Buster. The Pi is configured and running well. I've gone through and did the ./configure, make, sudo make install with libphidget22-1.5.20191007, libphidget22extra-1.5.20191007 and phidget22admin-1.5.20191007. I've also done the same with Phidget22Python_1.5.20191007 however when I try and run the example.py program, I get the same error:
Traceback (most recent call last):
File "/home/pi/Downloads/example.py", line 1, in <module>
from Phidget22.Phidget import *
File "/usr/lib/python3/dist-packages/thonny/backend.py", line 305, in _custom_import
module = self._original_import(*args, **kw)
ModuleNotFoundError: No module named 'Phidget22'
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: ImportError: No module named 'Phidget22'

Post by jdecoux »

Try using pip to install the Phidget22 package:

Code: Select all

pip install Phidget22
or

Code: Select all

pip3 install Phidget22
Powergrid
Fresh meat
Posts: 4
Joined: Mon Jul 25, 2011 11:04 am
Contact:

Re: ImportError: No module named 'Phidget22'

Post by Powergrid »

Hi jdecoux;

Thanks for the suggestion. When I tried it (while in the directory where the files uncompressed to), I got the following which I think indicates that it's already installed?

Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: Phidget22 in /usr/local/lib/python2.7/dist-packages/Phidget22-1.5.20191007-py2.7.egg (1.5.20191007)

Perhaps it's install correctly and the example I'm using isn't importing from the correct location?
Powergrid
Fresh meat
Posts: 4
Joined: Mon Jul 25, 2011 11:04 am
Contact:

Re: ImportError: No module named 'Phidget22'

Post by Powergrid »

All;

So, I had some minor success as I continue to flounder in the world of Phidgets on the Pi (and Linux in general, me thinks!).

I stumbled across an oddity when I was working on learning and wanted to play with Tkinter. My import statement was failing and after some web-research, I came to understand that Python 3.x should use "tkinter" for the import whereas Python 2.x should use "Tkinter". And, yes, the case matters!

Based on that, I thought I'd try some different variations for the Phidget import statements and I've seen some examples where the imports are using "Phidgets" instead of the "Phidget22" that the examples illustrate.

Bottom line is that if I use "Phidgets", then the modules are found. There is one exception and that is when I try the "Phidgets.Devices.Manager import form the HelloWorld.py example.

So, I think I'm really close however I'm just skirting the understanding of how to delve into what the imports needs in order to properly tie into the right module.

Any chance there's a "simple :? " way to figure this out?
jdecoux
Labview Developer
Posts: 161
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: ImportError: No module named 'Phidget22'

Post by jdecoux »

The "Phidgets" library you are referencing is the old Phidget21 libraries. Do not import "Phidgets" if you intend to use Phidget22.

The Phidget22 python libraries are designed to be cross-compatible with Python 2.7 and Python 3.

From what you're saying, there is a good chance your python program is looking in the wrong spot. If you have manually unzipped and installed the Phidget22 python libraries somewhere on your machine, I would recommend uninstalling (deleting) the manually installed libraries, and trying again with PIP.
nichawla
Fresh meat
Posts: 1
Joined: Sun Jun 21, 2020 6:05 am
Contact:

Re: ImportError: No module named 'Phidget22'

Post by nichawla »

Hi,

I used pip3 to successfully install the Phidget22 package, but I'm still receiving the same Import Error: No module named Phidget22

Could this be because the Phidget22 package was installed into a folder that is not the current folder I am using? If so, advice on how to move Phidget22 into my current folder would also be much appreciated.
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests