pyenv: how to install python dynamic/shared library
Asked Answered
W

1

6

When I compile python from source manually (with --enable-shared), I get a dynamic library in the lib directory. For example:

$ ls $PYTHON_INSTALLATION_DIRECTORY/lib
libpython3.9.so  libpython3.9.so.1.0  libpython3.so  pkgconfig  python3.9

However, when I install python using pyenv, I only get a static library:

$ ls .../pyenv/versions/3.9.13/lib
libpython3.9.a  pkgconfig  python3.9

How can I force pyenv to install Python dynamic library? What command I should run instead of

$ pyenv install --verbose 3.9.13

(I need to compile a software project which requires linking with python dynamic library)

Thank you very much for your help!

Windsor answered 23/6, 2022 at 13:11 Comment(0)
W
11

I have found a solution:

$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --verbose 3.9.13
Windsor answered 23/6, 2022 at 13:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.