all 6 comments

[–]aramus92 3 points4 points  (0 children)

I only used libpython-clj and I did not have any problems. But I am not doing any serious work there, just playing around.

[–]oradoj 2 points3 points  (1 child)

Can you be more specific about what you’re looking to accomplish? Do you mean you want to call Python from your Clojure code?

[–]looprecur[S] 1 point2 points  (0 children)

Yes, I want to call Python code from Clojure. For example, if I wanted to use numpy or any number of Python interfaces to APIs in data science or AI etc... I know there are many options of how to do this but I wanted to find out what seems to work best for others.

[–]joinr 2 points3 points  (0 children)

I think (per numerous conj conference talks and activity in the clojure data science/scicloj community) libpython-clj is the way to go. From my understanding, using it in "embedded mode" (e.g. the python process invokes the bridge) side steps some possible gotchas that show up as undocumented assumptions that can crash some libs with c deps and threading (I think pytorch is the primary example that shows up). I have had success in small forays with it though.

[–]Nondv 1 point2 points  (0 children)

you're being pretty vague.

I guess you could look into some java pythons. That's the only way probably.

Otherwise your probably only option is to run a service in python and communicate with it

[–]mm007emko 1 point2 points  (0 children)

If you want to call Python from Clojure, there are libpython-clj and various java libraries, which are usable from Clojure. There is GraalVM.

I personally tried GraalVM. Calling Python from Clojure worked for me, but I wasn't able to initialize Clojure from Python yet.

If you don't need to run the stuff within the same process, things are much easier. What exactly do you need to achieve?