You probably need to set the LD_PRELOAD environmental variable to the location of libpython. Ubuntu chose to build their native modules, such as _ssl without a dependency on libpython so symbols defined in libpython such as PyExc_OSError cannot be found unless they are globally defined, which can be done by setting LD_PRELOAD. This is described on the
linux portion of the wiki. On the dev_3.8 branch of jep I have code that attempts to work around this without LD_PRELOAD, you could also try that.
Ben