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'

Postby DamianBusz » Fri Dec 01, 2017 4:08 am

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: 652
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: ImportError: No module named 'Phidget22'

Postby mparadis » Fri Dec 01, 2017 12:19 pm

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'

Postby dmar » Sun Aug 05, 2018 6:08 pm

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'

Postby mwulff2125 » Mon Oct 14, 2019 6:31 am

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'

Postby Powergrid » Thu Oct 17, 2019 7:54 pm

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: 90
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: ImportError: No module named 'Phidget22'

Postby jdecoux » Fri Oct 18, 2019 10:05 am

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'

Postby Powergrid » Fri Oct 18, 2019 7:16 pm

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'

Postby Powergrid » Sun Oct 20, 2019 8:38 am

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: 90
Joined: Mon Nov 13, 2017 10:20 am
Contact:

Re: ImportError: No module named 'Phidget22'

Postby jdecoux » Mon Oct 21, 2019 1:53 pm

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.


Return to “Linux”

Who is online

Users browsing this forum: No registered users and 1 guest