Hi all,
I am trying to make the following workflow involving PythonCall to work in the same Julia session. I am experiencing some problems with PythonCall and SSL credentials, which thanks to @cjdoris I managed to make work by the following workflow which involved exit and enter again a new Julia session.
- In a new Julia session, I activate my envionment and then do
using OpenSSL_jll
- I close the session and open a new REPL
- In a new session, I can simply now do
using PythonCall; pyimport("ssl")
This workflow works, but if I just do the following in the same session
using OpenSSL_jll
using PythonCall; pyimport("ssl")
this returns instead the error
ERROR: Python: ImportError: dlopen(/Users/sapienza/.julia/dev/Sleipnir/.CondaPkg/env/lib/python3.12/lib-dynload/_ssl.cpython-312-darwin.so, 0x0002): Symbol not found: _X509_STORE_get1_objects
Referenced from: <B1CE67CC-8161-3609-8F45-6B9EC2F14447> /Users/sapienza/.julia/dev/Sleipnir/.CondaPkg/env/lib/python3.12/lib-dynload/_ssl.cpython-312-darwin.so
Expected in: <4C4C44CB-5555-3144-A104-41A9AFACD8FB> /Users/sapienza/.julia/artifacts/e33c9389fd079973c7a7520d36779612df7ec447/lib/libcrypto.3.dylib
Python stacktrace:
[1] <module>
@ ~/.julia/dev/Sleipnir/.CondaPkg/env/lib/python3.12/ssl.py:100
Stacktrace:
[1] pythrow()
@ PythonCall.Core ~/.julia/packages/PythonCall/Nr75f/src/Core/err.jl:92
[2] errcheck
@ ~/.julia/packages/PythonCall/Nr75f/src/Core/err.jl:10 [inlined]
[3] pyimport(m::String)
@ PythonCall.Core ~/.julia/packages/PythonCall/Nr75f/src/Core/builtins.jl:1561
[4] top-level scope
@ REPL[4]:1
Now, this is currently a big issue for me since I am trying to make this work inside a Julia package, so I need a workflow that works to be included in the main script of my library (here).
Furthermore, this is not a persistent solution, since the next time I want to do pyimport("ssl")
I also need to open a Julia session before to do the using OpenSSL_jll
. Does anyone know what OpenSSL_jll is exactly doing by just importing it right before the pyimport
?
I will highly appreciate if someone has some tip here that will help me progress on this problem!
Detains of the CondaPkg.toml
used to generate the environment can be found here. The complete workflow can be easely reproduced from the GitHub repo.
(Sorry if this feel a bit repetitive from other post, but I imagined this is a more general Julia topic that can be helpful to others, so I imagined a standalone post will be better.)