_ssl.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyExc_OSError

2,040 views
Skip to first unread message

Alejandro Kapit

unread,
Jan 28, 2018, 11:58:04 AM1/28/18
to Jep Project
Anybody know what this error means?

jep.JepException: <class 'ImportError'>: /usr/lib/python3.6/lib-dynload/_ssl.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PyExc_OSError
at /usr/lib/python3.6/ssl.<module>(ssl.py:101)



Same code works locally on OSX, in ubuntu I get that error.

Ben Steffensmeier

unread,
Jan 28, 2018, 3:53:26 PM1/28/18
to Jep Project
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

Alejandro Kapit

unread,
Jan 28, 2018, 5:32:50 PM1/28/18
to Jep Project
Interesting,
How can I know which directory to set on that env var?

Alejandro Kapit

unread,
Jan 28, 2018, 5:58:49 PM1/28/18
to Jep Project
I've just actually tried with dev_3.8 branch, but I get another issue

java.lang.UnsatisfiedLinkError: jep.Jep.initializePython([Ljava/lang/String;)V



On Sunday, January 28, 2018 at 10:53:26 PM UTC+2, Ben Steffensmeier wrote:

Ben Steffensmeier

unread,
Jan 29, 2018, 8:29:51 AM1/29/18
to Jep Project
The jep script that is installed with jep provides an example of how to configure your environment so that the python libraries can be loaded through JNI. Please try running the jep script to get an interactive python interpreter that is running through java. If that works then you need to set up an environment similar to the script.

Alejandro Kapit

unread,
Jan 29, 2018, 8:40:50 AM1/29/18
to Jep Project
got you, it works.


Thanks Ben!
Reply all
Reply to author
Forward
0 new messages