PaperTTY icon indicating copy to clipboard operation
PaperTTY copied to clipboard

Installing RPi.GPIO fails with Python 3.9

Open joukos opened this issue 3 years ago • 1 comments

Turns out the latest Raspberry Pi OS "Bullseye" uses Python 3.9 and RPi.GPIO does not yet play along with it nicely: https://raspberrypi.stackexchange.com/a/135164.

To work around this for now, update the dependencies section [tool.poetry.dependencies] in pyproject.toml by changing:

"RPi.GPIO" = "^0.7.0"

To:

"RPi.GPIO" = [
    {version = "^0.7.0", python = "<3.9"},
    {version = "^0.7.1a4*", python = "^3.9", allow-prereleases = true}
]

Then run poetry update.

(Interestingly the asterisk at the end is needed for it to work)

Will push the changes for this after testing it a bit more.

joukos avatar Jan 22 '22 08:01 joukos

I ran into this problem today, but it's easier to fix now 0.7.1 is out. Change that requirement to: "RPi.GPIO" = "^0.7.1"

mahood73 avatar Apr 06 '23 13:04 mahood73