RuntimeError: Could not determine platform.

January 20, 2024, 19:13

bradyaga0854

hey guys. can smb help me out? i have this code: https://pastebin.com/BifS2829 and when i try to run it, i get
Traceback (most recent call last):
  File "/home/aviete/Adafruit_Python_SSD1306/examples/shapes.py", line 46, in <module>
    disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aviete/.local/lib/python3.11/site-packages/Adafruit_SSD1306/SSD1306.py", line 287, in __init__
    super(SSD1306_128_32, self).__init__(128, 32, rst, dc, sclk, din, cs,
  File "/home/aviete/.local/lib/python3.11/site-packages/Adafruit_SSD1306/SSD1306.py", line 85, in __init__
    self._gpio = GPIO.get_platform_gpio()
                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/Adafruit_GPIO-1.0.4-py3.11.egg/Adafruit_GPIO/GPIO.py", line 429, in get_platform_gpio
RuntimeError: Could not determine platform.
can smb help me out? idk whats going on and ive been struggling with this piece of $hit for the whole day. can smb take a look? thanks

oops.se

That is a 10 year old code

oops.se

And the code was written when Python 2 was default and that has evolved to Python 3 now.

bradyaga0854

so theres no way to fix it?

oops.se

Probably as the libraries has been updated to python 3

bradyaga0854

is there any up to dat etutorial then?

oops.se

Google?

bradyaga0854

wdym?

_krazy.

Look for the information you want

_krazy.

Check whatever code you want to run with the updated libraries and Python 3

_krazy.

Or just degrade your to python 2, but it may have security flaws, beware of it when connecting it to the internet.