clj-python / libpython-clj

Python bindings for Clojure
Eclipse Public License 2.0
1.06k stars 69 forks source link

Problem loading python libraries in Closure #146

Closed mkhoshle closed 3 years ago

mkhoshle commented 3 years ago

Hi all,

I am totally new to Closure and I am trying to import my Python libraries into a Closure application. However, I am facing issues and have no ideas what can be done.

user=> (require '[libpython-clj.python :as py])
Syntax error (FileNotFoundException) compiling at (libpython_clj/python.clj:1:1).
Could not locate tech/v3/datatype/export_symbols__init.class, tech/v3/datatype/export_symbols.clj or tech/v3/datatype/export_symbols.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
user=> (System/getenv "PYTHONPATH")
"/opt/intel//openvino_2020.3.194/python/python3.7:/opt/intel//openvino_2020.3.194/python/python3:/opt/intel//openvino_2020.3.194/deployment_tools/open_model_zoo/tools/accuracy_checker:/opt/intel//openvino_2020.3.194/deployment_tools/model_optimizer:"
user=> (py/import-module "numpy")
Syntax error compiling at (REPL:1:1).
No such namespace: py
user=> (System/getenv "PYTHONHOME")
nil
(py/initialize! :library-path (format "%s/lib/libpython3.6m.so" 
                                            (System/getenv "PYTHONHOME")))
Syntax error compiling at (REPL:1:1).
No such namespace: py
(py/initialize! :library-path (format "%s/lib/libpython3.6m.so" 
                                            (System/getenv "PYTHONHOME")))
Syntax error compiling at (REPL:1:1).
No such namespace: py
user=> (sh/sh "python3" "--version")
Syntax error compiling at (REPL:1:1).
No such namespace: sh

Can anyone help me with the errors? What causing the issue?

jjtolton commented 3 years ago

Hi @mkhoshle! Sorry you're having troubles. We have a chat where it might be easier to help get started: https://clojurians.zulipchat.com/#narrow/stream/215609-libpython-clj-dev/topic/help-wanted

Also if you're looking for a small, friendly community of Clojure learners, @lambduhhh does a lot of Clojure community organization so checkout her discord server: https://linktr.ee/lambduhhh (click on :discord).

Welcome to the Clojure party and excited to help you get started!

cnuernber commented 3 years ago

@mkhoshle - Welcome :-).

It appears to me that there is version conflict somewhere as a required namespace is completely missing:

Could not locate tech/v3/datatype/export_symbols__init.class

How are you running your application?

cnuernber commented 3 years ago

Closing this - Please test with newest version of libpython-clj :-). Reopen of course if still an issue.