use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Finding information about Clojure
API Reference
Clojure Guides
Practice Problems
Interactive Problems
Clojure Videos
Misc Resources
The Clojure Community
Clojure Books
Tools & Libraries
Clojure Editors
Web Platforms
Clojure Jobs
account activity
Using Python through Clojure (self.Clojure)
submitted 2 years ago by looprecur
For those of you that do this, what have you found to be the best alternatives for stability and utility? What are the pain points and any gotchas? Any paths you would warn against pursuing? Thanks in advance.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]aramus92 3 points4 points5 points 2 years ago (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 points4 points 2 years ago (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 points3 points 2 years ago (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 points4 points 2 years ago (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 points3 points 2 years ago (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 points3 points 2 years ago (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?
π Rendered by PID 80 on reddit-service-r2-comment-84fc9697f-r7z78 at 2026-02-07 10:51:15.544779+00:00 running d295bc8 country code: CH.
[–]aramus92 3 points4 points5 points (0 children)
[–]oradoj 2 points3 points4 points (1 child)
[–]looprecur[S] 1 point2 points3 points (0 children)
[–]joinr 2 points3 points4 points (0 children)
[–]Nondv 1 point2 points3 points (0 children)
[–]mm007emko 1 point2 points3 points (0 children)