'No module named 'RPi.GPIO' ; 'RPi' is not a package

Thank you to all the contributors with their posts correlating to RPI.GPIO. I have tried most of your suggestions but so far to no avail.

My current version: 0.7.1a4, I'm running bullseye on Pi4 and a python3 programm which should import RPi.GPIO as GPIO. Instead I get: ModuleNotFoundError: No module named 'RPi.GPIO'; 'RPi' is not a package`.

On a bullseye headless the same program imports RPi.GPIO as GPIO without a problem.

I have tried various RPi.GPIO installation methods and am receiving as many different messages in return. But nothing so far has solved anything. And now I am without a clue as to where to look or do next.

When I try to install using the commands I have found I get this message: Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: RPi.GPIO in /usr/lib/python3/dist-packages (0.7.0)

Reinstall raspberry Pi OS Full(32-bit) ; deactivate and reactivate the interfaces and there is still the problem.

In case of not finding a solution, how else could I control two motors without having to use GPIO?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source