I need to build a redistributable, self-contained Python environment using pyenv on macOS.
The problem I'm running into is that there are dependencies on dynamic libraries. These dependencies include the full path of the dynamic library (e.g., libssl.1.0.0.dylib
under /usr/local/opt/
). For example, one of the dependencies of the Python ssl
module is lib-dynload/_ssl.cpython-37m-darwin.so
which references the system libssl.
I cannot redistribute this because users don't always have openssl in the same directory as my build machine. I cannot control the location where users will install my bundle because it will be in their home directory. So absolute paths are right now.
I considered using rpath
, which lets dynamic libraries specify their dependencies with relative paths. That appears to have security issues, so I'd prefer not to use it.
Is it possible to configure pyenv to use static libraries when possible, such as for openssl?