Python Interop on a (32-bit, ARM) Raspberry Pi Zero?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- embedded-iot, tooling
Direzione di ricerca
Riproduci il malfunzionamento dal Clojure REPL con libpython-clj.python/initialize! e py/run-simple-string nell’ambiente Raspberry Pi ARM a 32 bit descritto. Inizia da libpython-clj/jna/base.clj:20 e traccia il valore nil segnalato dal protocollo PToPyObjectPtr; il lavoro è concluso quando è stato identificato se il malfunzionamento è causato dalla piattaforma, dal runtime Java o dalla configurazione del progetto e viene registrata una soluzione verificata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Thanks for this project! I enjoyed the talk from this year's Conj and it made me want to dive right in.
My use case is somewhat unique, I think: I'm trying to use Python to drive some hardware I have soldered to the GPIO pins on a Raspberry Pi Zero. The Pi is a 32-bit ARM processor, and Python works great on it... but Python interop has been giving me a bit of trouble.
Here's what we're working with:
$ ldconfig -p | grep python
libpython3.7m.so.1.0 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libpython3.7m.so.1.0
libpython3.7m.so (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libpython3.7m.so
libpython2.7.so.1.0 (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libpython2.7.so.1.0
libpython2.7.so (libc6,hard-float) => /usr/lib/arm-linux-gnueabihf/libpython2.7.so
and Java:
$ java -version
openjdk version "1.8.0_152"
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)
I'm using Python 3.7 to drive the hardware, and Python itself runs fine.
Likewise, I can run Clojure (both JARs and Clojure in the REPL) without any issue.
But when I try to run Python from within Clojure via the REPL, here's what happens:
=> (require '[libpython-clj.python :as py])
nil
=> (py/initialize!)
Jan 09, 2020 3:05:16 AM clojure.tools.logging$eval1906$fn__1909 invoke
INFO: Executing python initialize!
Jan 09, 2020 3:05:17 AM clojure.tools.logging$eval1906$fn__1909 invoke
INFO: Startup info detected: {:python-home "/usr", :lib-version "3.7", :libname "python3.7m", :java-library-path-addendum "/usr/lib"}
Jan 09, 2020 3:05:17 AM clojure.tools.logging$eval1906$fn__1909 invoke
INFO: Reference thread starting
Jan 09, 2020 3:05:18 AM clojure.tools.logging$eval1906$fn__1909 invoke
INFO: Library python3.7m found at [:system "python3.7m"]
Execution error (IllegalArgumentException) at libpython-clj.jna.base/eval22533$fn$G (base.clj:20).
No implementation of method: :->py-object-ptr of protocol: #'libpython-clj.jna.base/PToPyObjectPtr found for class: nil
The error repeats itself if you try any other commands:
=> (py/run-simple-string "print('Hello')")
Execution error (IllegalArgumentException) at libpython-clj.jna.base/eval22533$fn$G (base.clj:20).
No implementation of method: :->py-object-ptr of protocol: #'libpython-clj.jna.base/PToPyObjectPtr found for class: nil
I started the repl using lein repl in a new project root.
The project was scaffolded with the lein new app command.
Do you see anything off the top of your head that may be the root cause of these issues?
My gut tells me it's one of three things:
- The 32-bit ARM processor, and everything that goes along with that
- The Zulu Embedded Java 8 JDK
- Something dumb that I haven't noticed yet.
Any thoughts as to why this is happening, or is there any more information I could provide?
Really appreciate your time. Thank you!
- Lingua principale
- Clojure
- Stelle
- 1.2k
- Fork
- 74
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di clj-python/libpython-clj
-
upgrade to dtype-next 11.xxx Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
clj-python/libpython-clj#280 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
clj-python/libpython-clj#275 · 5 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
clj-python/libpython-clj#273 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
clj-python/libpython-clj#271 · 1 commento ·
-
"auto flush" tty optionally Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
clj-python/libpython-clj#270 · 1 commento ·
Tutte le issue di clj-python/libpython-clj
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
.Team/Metabot Priority:P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
needs triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100