WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: python3.11-rpi-gpio broken  (Read 1536 times)

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
python3.11-rpi-gpio broken
« on: December 08, 2023, 05:40:00 PM »
Hi,
I'm using piCore 14.0 on a Pi Zero W.  I installed the python3.11-rpi-gpio package but there's a problem with it:

tc@box:~$ python3
Python 3.11.4 (main, Aug 22 2023, 19:25:35) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO
Illegal instruction

I'm not sure where to go from here... help!

Thanks,
Rob.

Online Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1267
Re: python3.11-rpi-gpio broken
« Reply #1 on: December 08, 2023, 07:11:08 PM »
seems I copied the aarch64 version of the extension here.  should be fixed.

One thing to note is that RPI.GPIO is going obsolete in future releases.  The way the kernel handles gpio is changing.

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: python3.11-rpi-gpio broken
« Reply #2 on: December 09, 2023, 11:02:38 AM »
Thank you, Paul.

However, this is strange - I removed and reinstalled the package, and it looks like I've got the updated file, but I'm still seeing the same error:

tc@box:~$ file /tmp/tcloop/python3.11-rpi-gpio/usr/local/lib/python3.11/site-packages/RPi/_GPIO.cpython-311-arm-linux-gnueabihf.so
/tmp/tcloop/python3.11-rpi-gpio/usr/local/lib/python3.11/site-packages/RPi/_GPIO.cpython-311-arm-linux-gnueabihf.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, stripped
tc@box:~$ python3
Python 3.11.4 (main, Aug 22 2023, 19:25:35) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO
Illegal instruction

What am I doing wrong?

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: python3.11-rpi-gpio broken
« Reply #3 on: December 09, 2023, 12:18:08 PM »
Meanwhile I've worked around it by installing the package with pip3 (after installing all the dependencies it needed).

For what it's worth, I was trying to install the Python neopixel lib, which requires the blinka lib, which requires RPi.GPIO.  Hopefully Adafruit will update those libraries before RPi.GPIO changes...

Online Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1267
Re: python3.11-rpi-gpio broken
« Reply #4 on: December 09, 2023, 12:23:15 PM »
file will not show you the required instruction set.  You need readelf for that.  python is getting super problematic, when building using pip/setuptools and a pi4 to build code.

I just re-uploaded, and then fired up a pizero and tested it out.  Should be fine now....  if you are using the main repo.  If using a mirror, it might take a day to update.

Code: [Select]
tc@pi:~$ readelf -A /usr/local/lib/python3.11/site-packages/RPi/_GPIO.cpython-311-arm-linux-gnueabihf.so
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6ZK"
  Tag_CPU_arch: v6KZ
  Tag_ARM_ISA_use: Yes
  Tag_THUMB_ISA_use: Thumb-1
  Tag_FP_arch: VFPv2
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_align_preserved: 8-byte, except leaf SP
  Tag_ABI_enum_size: int
  Tag_ABI_VFP_args: VFP registers
  Tag_CPU_unaligned_access: v6
  Tag_Virtualization_use: TrustZone
tc@pi:~$ python3
Python 3.11.4 (main, Aug 22 2023, 19:25:35) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO
>>>

Online Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1267
Re: python3.11-rpi-gpio broken
« Reply #5 on: December 09, 2023, 12:24:15 PM »
Well python is a changing too.  Virtual environments is going to be forced down your throat soon too.

Offline DrRob

  • Jr. Member
  • **
  • Posts: 61
Re: python3.11-rpi-gpio broken
« Reply #6 on: December 09, 2023, 02:46:02 PM »
That worked, thanks.