poe-api icon indicating copy to clipboard operation
poe-api copied to clipboard

Not supported on armv7l/raspberrypi

Open duckida opened this issue 2 years ago • 4 comments

When I try sending a message from a Raspberry Pi using Python, I receive the following error:

File "poetest.py", line 1, in <module>
import poe
  File "/home/pi/.local/lib/python3.7/site-packages/poe.py", line 3, in <module>
    import tls_client as requests_tls
  File "/home/pi/.local/lib/python3.7/site-packages/tls_client/__init__.py", line 15, in <module>
    from .sessions import Session
  File "/home/pi/.local/lib/python3.7/site-packages/tls_client/sessions.py", line 1, in <module>
    from .cffi import request, freeMemory
  File "/home/pi/.local/lib/python3.7/site-packages/tls_client/cffi.py", line 20, in <module>
    library = ctypes.cdll.LoadLibrary(f'{root_dir}/dependencies/tls-client{file_ext}')
  File "/usr/lib/python3.7/ctypes/__init__.py", line 434, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python3.7/ctypes/__init__.py", line 356, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /home/pi/.local/lib/python3.7/site-packages/tls_client/dependencies/tls-client-amd64.so: wrong ELF class: ELFCLASS64

It seems a dependency is designed only for amd64 architecture, and so it will not work on armbased devices. Does anyone know how to patch this or have another API I could use, as this may also be a problem for M1/2 arm based Macs.?

duckida avatar Jul 01 '23 13:07 duckida

This is likely an issue with the tls-client package which doesn't seem to be compiled for ARM. Raise an issue there or compile it yourself.

ading2210 avatar Jul 01 '23 14:07 ading2210

Here is a workaround. In the poe.py file, change import tls_client as requests_tls to import request as requests_tls

ichuixue avatar Jul 02 '23 03:07 ichuixue

Here is a workaround. In the poe.py file, change import tls_client as requests_tls to import request as requests_tls

Might get you banned if they detect bot usage

acheong08 avatar Jul 05 '23 03:07 acheong08

I managed to download tls-client using someone's GIT repositiry on the Pi and that was the arm7l version.

duckida avatar Jul 08 '23 16:07 duckida