I am new to RPi, though have lot of experience with Arduino. I recently installed the 'gpiozero' module to my RPi system, and while trying to run a simple LED on-off file, I encounter an error...something like this....

Traceback (most recent call last ):
File "user/lib/python3/dist-packages/gpiozero/pins/rpigpio.py", line 57, in RPI.GPIO.Pin 'pwm': GPIO.HARD_PWM, AttributeError: 'module' object has no attribute 'HARD_PWM'

What does this mean? I am stuck up, what to do next, please help.

  • What's your script called. If it's gpiozero.py Rename it to my_gpiozero.py mv gpiozero.py my_gpiozero.py and remove any *.pyc files with rm *.pyc. Python always searches the current directory first for any scripts or imported scripts. – Dougie Apr 4 at 19:19
  • 3
    You have removed the useful information from the traceback. If you put it back in it may be possible to give an answer. – joan Apr 4 at 19:47
  • What @joan said, plus it looks like either you named your file RPi.py or you have a broken installation of RPi.GPIO. – ben_nuttall Apr 5 at 12:44
  • Many Thanks to all of you, will check with file name, removing the .pyc, and will give full feedback details again in the error included details in the traceback... – user2064616 Apr 6 at 14:54
  • is there any quick way to confirm if installation of 'gpiozero' has been fully/completely done ? or I need to uninstall and install again ? – user2064616 Apr 6 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.