ading2210 / poe-api

[UNMAINTAINED] A reverse engineered Python API wrapper for Quora's Poe, which provides free access to ChatGPT, GPT-4, and Claude.
https://pypi.org/project/poe-api
GNU General Public License v3.0
2.5k stars 314 forks source link

Not supported on armv7l/raspberrypi #138

Open duckida opened 1 year ago

duckida commented 1 year ago

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.?

ading2210 commented 1 year ago

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.

ichuixue commented 1 year ago

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

acheong08 commented 1 year ago

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

duckida commented 12 months ago

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