What exactly does ./configure --enable-shared do during python altinstall?

前端 未结 3 845
感动是毒
感动是毒 2021-01-31 11:24

When I altinstall python 2.7.12 with

./configure --prefix=/opt/python --enable-shared

it comes up as python 2.7.5 (system default python

3条回答
  •  孤独总比滥情好
    2021-01-31 11:40

    Compiling python like this fixed my issue:

    ./configure --enable-shared --prefix=/opt/python LDFLAGS=-Wl,-rpath=/opt/python/lib
    

    Courtesy Ned Deily:

    The problem is, that on most Unix systems (with the notable exception of Mac OS X), the path to shared libraries is not an absolute path. So, if you install Python in a non-standard location, which is the right thing to do so as not to interfere with a system Python of the same version, you will need to configure in the path to the shared library or supply it via an environment variable at run time, like LD_LIBRARY_PATH. You may be better off avoiding --enable-shared; it's easy to run into problems like this with it.

    Ref: https://bugs.python.org/issue27685

提交回复
热议问题