Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pyenv: how to install python dynamic/shared library

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!

like image 936
S.V Avatar asked Sep 04 '26 16:09

S.V


1 Answers

I have found a solution:

$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install --verbose 3.9.13
like image 99
S.V Avatar answered Sep 06 '26 07:09

S.V



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!