Hi everyone. I recently installed python 3.9.11 on my system using pyenv. However when I try to run the following code : I get an error : No module gpiozero. I'm not running this code on a virtual environment. Any ideas on how to fix this?
When I try to create a virtual environment using :The packages are not available in the environment.
Is there any explanation as to way this happens? Any fix would be appreciated. Thanks!
Code:
from gpiozero import AngularServofrom gpiozero.tools import sin_valuesfrom signal import pausefrom time import sleepservo=AngularServo(18, min_angle=0, max_angle=180, min_pulse_width=0.0007, max_pulse_width=0.0025)servo.angle = 0sleep(2)print("0")servo.angle = 180sleep(2)print("180")
When I try to create a virtual environment using :
Code:
python3.9 -m venv --system-site-packages env
Is there any explanation as to way this happens? Any fix would be appreciated. Thanks!
Statistics: Posted by wasedxs — Thu Mar 21, 2024 7:30 am