PythonCall SSL Verify Error when calling pd.read_csv

Hello, I’m trying to read a CSV file with Pandas, and I’m getting the following error:

function example52()
    points = pd.read_csv("https://raw.githubusercontent.com/thomasnield/machine-learning-demo-data/master/regression/single_independent_variable_linear_small.csv", delimiter=pystr(",")).itertuples()
end

And the stack trace

ERROR: Python: URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1000)>
Python stacktrace:
 [1] do_open
   @ urllib.request ~/work/MathForDataScience/.CondaPkg/env/lib/python3.12/urllib/request.py:1347
 [2] https_open
   @ urllib.request ~/work/MathForDataScience/.CondaPkg/env/lib/python3.12/urllib/request.py:1392

I know this is probably due to how the Conda environment is configured. I use CondaPkg with no additional configuration, which looks like it uses MicroMamba to do the Python management. I already had to use CondaPkg to downgrade SSL to 3.3.0 so that the Python SSL module could find it, but stuck on this error now.

You need to downgrade OpenSSL to 3.0. Julia is currently tracking the OpenSSL LTS.

@cjdoris , I am wondering if could consider pinning package versions of some dependencies to match the corresponding dependency versions that Julia uses. That might be able to avoid situations like this.

Yep we already do this for libstdc++ here: CondaPkg.jl/src/resolve.jl at 9b73ea5c68bd7e19ba7a946e0ebf96542d0ace4f · JuliaPy/CondaPkg.jl · GitHub

Feel free to make a PR with similar functionality for OpenSSL.

I have what it looks the same problem with Julia 1.11 using the python package chelsa-cmip6 that downloads climatic data (apparently using pandas), installed using CondaPkg.add_pip().

I got the following error:

ERROR: Python: URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:992)>
Python stacktrace:
 [1] do_open
   @ urllib.request ~/.julia/dev/GenFSM/test/.CondaPkg/.pixi/envs/default/lib/python3.11/urllib/request.py:1351
 [2] https_open
   @ urllib.request ~/.julia/dev/GenFSM/test/.CondaPkg/.pixi/envs/default/lib/python3.11/urllib/request.py:1391
...
 [7] urlopen
   @ pandas.io.common ~/.julia/dev/GenFSM/test/.CondaPkg/.pixi/envs/default/lib/python3.11/site-packages/pandas/io/common.py:289
...
 [17] chelsa_cmip6
   @ chelsa_cmip6.GetClim ~/.julia/dev/GenFSM/test/.CondaPkg/.pixi/envs/default/lib/python3.11/site-packages/chelsa_cmip6/GetClim.py:455

I haven’t understood the previous answers (I don’t know Conda nor OpenSSL). Is it a package at the level of the OS (Ubuntu) that I need to downgrade ? As the code is to go into a package, is there a way to make this issue OS-independent ?

How you did it ?