You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When both OpenSSL and PythonCall are loaded pyimport("ssl") fails if an external python executable is used.
julia>ENV["JULIA_PYTHONCALL_EXE"] =joinpath(ENV["MAMBA_ROOT_PREFIX"], "bin", "python")
julia>using OpenSSL, PythonCall
julia>println(pyimport("sys").executable)
julia>pyimport("ssl")
/opt/conda/bin/python
ERROR: Python: ImportError:/home/mambauser/.julia/artifacts/625d0c7f43b3ae48c9d49a1a17970e8e9d7e271b/lib/libcrypto.so: version `OPENSSL_3.3.0' not found (required by /opt/conda/lib/python3.10/lib-dynload/_ssl.cpython-310-aarch64-linux-gnu.so)Python stacktrace: [1] <module> @ /opt/conda/lib/python3.10/ssl.py:99
Obviously, the python import tries to load Julia's OpenSSL cryptolibrary although the calling python executable is correctly set.
A workaround is to import the ssl module before loading OpenSSL. However, I am not sure whether Julia's OpenSSL will function properly.
The better workaround might be to install the identical versions of openssl, if you have the freedom to do so.
In my case the following installation made the error disappear:
micromamba install -c conda-forge openssl=3.3.0
as the error above contained version OPENSSL_3.3.0' not found`.
This is still a bit puzzling to me, as the current latest OpenSSL_jll version is 3.0.15, but at least I could make my program run again.
Hope this can be of help for people with similar library collisions.
Yep as you've found, if you use Julia and Python packages that both rely on the same underlying library, it's often important to ensure the packages are at somewhat compatible versions so that the library they actually use is not to different than the one they expect.
If you use PythonCall with the default settings then CondaPkg will try to install a version of Python OpenSLL that is compatible with Julia's OpenSSL. If you use your own Python environment then it's up to you to ensure this compatibility.
It's possible we could insert a warning somewhere for common cases of incompatible libraries.
Thanks for your comment and good to know that care has been taken to provide best possible compatibility. I might change my Docker containers to rely on CondaPkg rather than on micromamba then.
Affects: PythonCall
Describe the bug
When both OpenSSL and PythonCall are loaded
pyimport("ssl")
fails if an external python executable is used.Obviously, the python import tries to load Julia's OpenSSL cryptolibrary although the calling python executable is correctly set.
A workaround is to import the ssl module before loading OpenSSL. However, I am not sure whether Julia's OpenSSL will function properly.
Interestingly, I didn't succeed in using the CondaPkg's python version:
My system
The text was updated successfully, but these errors were encountered: