Python 3.7 import gpiozero ModuleNotFoundError No module named 'gpiozero' on raspberry pi zero

Garry Osborne picture Garry Osborne · Sep 8, 2018 · Viewed 7.4k times · Source

Built Python 3.7 on my Raspberry pi zero in a attempt to upgrade from Python 3.5.3 The build was successful, ran into the module not found for smbus and switched that to smbus2, now when I import gpiozero I get Module not found. my DungeonCube.py program was working fine under Python 3.5.3, but now Python 3.7 seems to have trouble finding gpiozero

this is what I did to test:

python3
Python 3.7.0 (default, Sept 7 2018, 14:22:04)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gpiozero
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'gpiozero'
>>>

anyone know how to get python 3.7 to see gpiozero module?

Answer

Adarsha picture Adarsha · Sep 5, 2019

I had same problem, realized that i used pip3 to install the package, but I was trying to use it with python which invokes python2. I tried with python3 it works just fine.