libpython-clj icon indicating copy to clipboard operation
libpython-clj copied to clipboard

Issues with using libpython-clj with pyenv installed python version

Open bajrachar opened this issue 4 years ago • 2 comments

OS: Arch 5.15.11-arch2-1 Libpython-clj 2.006 pyenv 2.2.3

I get a "Failed to find a valid python library!" when using a python library version set as global using pyenv [which is a different version from the system installed one]. It works fine when global is set to the system installed version.

Digging further into libpython-clj code, I found that it is actually trying to find the libpython.so file and the pyenv installed version only installs a libpython.a file.

It worked for me by forcing pyenv to generate a .so file --> $ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.7.5

bajrachar avatar Dec 31 '21 03:12 bajrachar

That’s great. I can’t tell you how many times this has gotten me. Glad to finally see the proper installation pathway!

On Thu, Dec 30, 2021 at 10:34 PM bajrachar @.***> wrote:

OS: Arch 5.15.11-arch2-1 Libpython-clj 2.006

I get a "Failed to find a valid python library!" when using a python library version set as global using pyenv [which is a different version from the system installed one]. It works fine when global is set to the system installed version.

Digging further into libpython-clj code, I found that it is actually trying to find the libpython.so file and the pyenv installed version only installs a libpython.a file.

It worked for me by forcing pyenv to generate a .so file --> $ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.7.5

— Reply to this email directly, view it on GitHub https://github.com/clj-python/libpython-clj/issues/193, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPJX43OQ4U27KGRTRXTBW3UTUQEBANCNFSM5LAWMQZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

jjtolton avatar Dec 31 '21 05:12 jjtolton

FYI: For those on a Mac with pyenv this also works

e.g.

env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.10.2
❯ pyenv root
/Users/blah/.cache/pyenv
(py/initialize! :python-executable "/Users/blah/.cache/pyenv/versions/3.10.2/bin/python"
                :library-path "/Users/blah/.cache/pyenv/versions/3.10.2/lib/libpython3.10.dylib")

thecontinium avatar Jan 30 '22 15:01 thecontinium

can be closed ?

behrica avatar Oct 03 '23 19:10 behrica

Yes - can be reopened as I am sure we will hear more about this

cnuernber avatar Oct 04 '23 01:10 cnuernber