Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8037

Python • Re: ImportError: : no module named 'gpiozero'

$
0
0
First remember to encase all imports in try/except blocks. Next share the printout of this:

Code:

try:        import sys except:        print("no sys")        exit(1)try:        from gpiozero import LED except Exception as e:        print(e)        print(f"Python version: {sys.version}")        print(f"Python binary: {sys.executable}")        print("Python PATH:")           for x,y in enumerate(sys.path):print(f"{x}::  {y}")        exit(1)print("passed")

And what is your script filename?

Statistics: Posted by valkyrie44 — Mon Feb 02, 2026 9:37 pm



Viewing all articles
Browse latest Browse all 8037

Trending Articles