-
-
Notifications
You must be signed in to change notification settings - Fork 70
Execution error (NullPointerException) at tech.jna.base/fn (base.clj:35). #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi! Can you post some more details please? What system are you using, what version of libpython-clj, what repl, etc? |
Great, did you get it working? :D That's the most important thing! |
{:clojure.main/message |
hmmm g,.g java -jar standalone can execute~* but can't require libpython-clj/target]$ java -jar libpython-clj-1.17-SNAPSHOT-standalone.jar I'm linux master (git clone ~) Thanks. |
hmmm. So running the jar standalone works but attempting to just start a repl and do a require of the main namespace into the user namespace is giving you that error? |
The module will now be loaded. next problem.clojure.lang.ExceptionInfo: Failed to load library wrong when you do (py/initialize!). and I change code to 3.6m to 3.7m (libpython-clj/src/libpython_clj/jna/base.clj) good day~* :) thanks! |
Sorry you're still having trouble with this! The next major release should be out soon and after that I think we can start to prioritize some better tutorials and "getting started" documentation. I notice that you're using 1.17-SNAPSHOT. That might be part of the problem. Try with 1.12, 1.13 or 1.16 and see if that helps |
The nugget of information here is: [:java-library-path ["/run/opengl-driver/lib/libpython3.7m.so" "/run/opengl-driver-32/lib/libpython3.7m.so" "/usr/java/packages/lib/libpython3.7m.so" "/usr/lib64/libpython3.7m.so" "/lib64/libpython3.7m.so" "/lib/libpython3.7m.so" "/usr/lib/libpython3.7m.so"]]
The trick would be to get the java-library-path to include the above directory when starting or for us to find whatever environment variable has that second pathway in it and attempt to read it and setup some state before loading python. Closing for now but if we can keep going this direction it would be helpful. |
@PlumpMath - For conda specifically, I have a workaround: |
I solved ^,.^ yesterday because you gave me hint. thanks. |
Anyway, I was lucky to find this project a few days before your announcement of clojure 2019. I'm working on 3D related development company job work is clojure and clojurescript and unity3d blender webgl 3d... Onz... I hate ai & ml... cause dont know. Unfortunately, I can't use this good module freely because I can't English. I got a strange question. Anyway, I'll going to learn linear algebra with this next year... Again, thank you very much for making it. |
As of version 1.20+ you can use (ns myproject.core
(:require [libpython-clj.python :as python]
[libpython-clj.require :refer [require-python]))
(require-python '(math requests))
(math/sin 1)
(requests/get "https://www.google.com") |
We're still actively working on the API, please feel free to join the discussion, @PlumpMath! (https://clojurians.zulipchat.com/#narrow/stream/215609-libpython-clj-dev) I'm also learning to make games with Clojure/Script! :D |
Having the same problem going to check java path |
Not sure what the problem was but for any other noobs, I was having "Could not locate libpython_clj__init.class, libpython_clj.clj or libpython_clj.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name." fixed using: (ns annoying (:require [libpython-clj2.python :as py])) (py/initialize! :python-executable "/usr/bin/python3.9" (require '[libpython-clj2.require :refer [require-python]]) From emacs C-c C-k complie works |
Clojure 1.10.1
user=> (ns user (:require [libpython-clj.python :as py]))
Execution error (NullPointerException) at tech.jna.base/fn (base.clj:35).
null
I'm use python 3.7 and compile project as lein uberjar.
Thanks.
The text was updated successfully, but these errors were encountered: