[Python] pyCurl won't retrieve https: site

Discussão em 'Python' iniciado por Stack, Março 24, 2025.

  1. Stack

    Stack Membro Participativo

    MacBook Pro, macOS 15.3.2. Using PyCharm 2024.3.5, pyCurl 7.45.6, trying sample code from http://pycurl.io/docs/latest/quickstart.html, resulting error message "Protocol https not supported or disabled in libcurl". Changing URL to other sites doesn't help. When I run curl from the command line with --version option, https is listed as supported protocol, and I can retrieve multiple https: URLs from command line. Any help?

    buffer = BytesIO()
    c = pycurl.Curl()
    c.setopt(c.URL, 'https://pycurl.io/')
    c.setopt(c.WRITEDATA, buffer)
    c.setopt(c.CAINFO, certifi.where())
    c.setopt(c.VERBOSE, True)
    c.perform()
    c.close()


    Output is:

    Protocol https not supported or disabled in libcurl

    Closing connection -1

    Traceback (most recent call last): File "/Users/larry/PycharmProjects/LotteryDataGrab/LotteryGrab.py", line 16, in c.perform()

    pycurl.error: (1, 'Protocol https not supported or disabled in libcurl')

    Continue reading...

Compartilhe esta Página