regression: can't import RPi.GPIO on RPi model B
A Python module to control the GPIO on a Raspberry Pi
Brought to you by:
croston
I tried bringing up some software that was previously working on the original Raspberry Pi under the latest OS release and can no longer import RPi.GPIO:
Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as GPIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 927, in <module>
RPI_INFO = _get_rpi_info()
^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 428, in _get_rpi_info
raise NotImplementedError(
NotImplementedError: This module does not understand old-style revision codes
>>> import RPi.GPIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 927, in <module>
RPI_INFO = _get_rpi_info()
^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 428, in _get_rpi_info
raise NotImplementedError(
NotImplementedError: This module does not understand old-style revision codes
>>>
When I rolled the device back to Bullseye, I was able to import the module.
Update: I upgraded from Bullseye to Bookworm (with this as a guide), and everything continued working as it should. Possible packaging problem by Raspberry Pi?