[Python] SSL: CERTIFICATE_VERIFY_FAILED when running packaged Python app on a different Mac

Discussão em 'Python' iniciado por Stack, Setembro 27, 2024.

  1. Stack

    Stack Membro Participativo

    I have a script written in Python that I'd like to distribute to other people who might not have Python installed and want a GUI, so I built it into an macOS app using Flet. It runs fine on my MacBook running macOS 14.7, but when I send the app to other people it won't start. If they run the unix executable instead of the packaged app they get this error:

    Matplotlib is building the font cache; this may take a moment. Traceback (most recent call last): File "urllib/request.py", line 1346, in do_open File "http/client.py", line 1285, in request ... File "ssl.py", line 1343, in do_handshake ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1133)

    I don't really understand why I'm getting this since my script doesn't require an internet connection to run.

    Some other context: I tried packaging the app using both PyInstaller and Flet since it has a built-in function. I'm using Anaconda and I created a Python 3.9 virtual environment and only installed the packages that I needed (numpy, Matplotlib, flet, etc.) using Anaconda Navigator. I didn't use the base environment since I didn't want any extra bloat that I didn't need from everything that conda has.

    Would appreciate any help, thanks!

    Continue reading...

Compartilhe esta Página