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!

1 Answer 1

12

I have found a solution:

$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --verbose 3.9.13
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.