1

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?

Garry Osborne
  • 87
  • 2
  • 4
  • 11

2 Answers2

1

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.

Adarsha
  • 2,267
  • 22
  • 29
-1

did you download the gpiozero module onto the raspberry pi? it does not come preinstalled with python.

you could try to do "sudo python3 pip install gpiozero". if that doesnt work replace python3 with python @GarryOsborne .

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
javajav
  • 379
  • 3
  • 10
  • Hi JavaJav, yes it was already installed and working under python 3.5.3 before I built python 3.7. after I received the error I uninstalled gpiozero and rebuilt it successfully with: `git clone https://github.com/RPi-Distro/python-gpiozero.git` then `sudo python3 setup.py install` that all went fine but still can't import it into python 3.7 – Garry Osborne Sep 08 '18 at 15:51
  • tried `sudo pip3 install giozero` it comes back with requirement already satisfied. – Garry Osborne Sep 08 '18 at 16:00
  • Downvote because `sudo` should NOT be used with python or pip, it causes problems. Also, you're mashing up two commands that should only be used separately: `python -m install ` and `pip install `. Good luck! – Under-qualified NASA Intern Jun 15 '22 at 14:46
  • Fair enough, can you please edit it? When I try it says "suggested edit queue is full"... – Under-qualified NASA Intern Jun 16 '22 at 20:28