0

I've been trying to get the gpiozero module into Thonny for a while (for use with a Raspberry Pi) and I've been having lots of issues with it. I installed gpiozero using the package installed inside Thonny and then called import gpiozero on line 1. However, I keep getting some sort of error:

Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/lib/gpiozero/__init__.py", line 19, in <module>
 File "/lib/gpiozero/pins/__init__.py", line 12, in <module>
ImportError: no module named 'warnings'

I tried downloading the warnings module and importing it to but that didn't work. I also tried this with several other modules, such as pyautogui, keyboard, and krpc. None of these worked either. I have tried deleting Thonny and reinstalling it (64 bit, python 3.10) and that didn't work either. In addition I have also been getting a weird error from the Thonny module installer:

Copying colorzeroError (ManagementError(...), 'Command output was not empty')

What's going on?

mkrieger1
24.2k7 gold badges68 silver badges84 bronze badges
asked Feb 19, 2025 at 20:56
7
  • 1
    ImportError: no module named 'warnings' , this kind of errors usually come when some dependencies of packages are not installed. In your case check if all the packages and their dependencies are installed properly. You can do that with pip check. This warning package is usually a dependency of pytest package, and for your package it is an optional dependency github.com/gpiozero/gpiozero/blob/… Commented Feb 20, 2025 at 6:53
  • I tried this and got "No broken requirements found.". Is that good or bad? Commented Feb 20, 2025 at 15:15
  • That is good. It shows that all the required packages are installed. To further get help with this, you need to provide more context in question including sample code and imports. Commented Feb 21, 2025 at 7:25
  • The code is simply [import gpizero]. Nothing else at all. Commented Feb 23, 2025 at 1:43
  • How do I bump this question? I tried editing bump into the post, but a moderator removed it and didn't even attempt to help answer the question. How rude. Commented Feb 27, 2025 at 17:35

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.