[Python] ImportError: pycurl: libcurl link-time version (7.79.1) is older than compile-time...

Discussão em 'Python' iniciado por Stack, Maio 23, 2025.

  1. Stack

    Stack Membro Participativo

    I know this question has been asked before, but none of the solutions seem to be working for me. I am running this on Mac OS Monterey (12.6.1). Installed Python 3.7.12 (using pyenv) and using Poetry as a dependency manager.

    I did the following steps after activating & deactivating the virtual environment using poetry (source $(poetry env info --path)/bin/activate)

    1. Removed existing pycurl using brew
    2. Installed openssl (brew install openssl)
    3. Verified ssl installation directory

    brew --prefix openssl
    /opt/homebrew/opt/openssl@3

    $ ls -la /usr/local/opt/openssl@3
    lrwxr-xr-x 1 xxxxxx admin 25 14 Dec 22:57 /opt/homebrew/opt/openssl@3 -> ../Cellar/openssl@3/3.0.7

    1. Install PyCurl specifying inline the above openssl install directories like this

    PYCURL_SSL_LIBRARY=openssl LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib" CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include" pip install --no-cache-dir pycurl


    PyCurl installs without any problem but when I try to import pyCurl I get the following error message.

    Python 3.7.12 (default, Dec 14 2022, 22:00:27)
    [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pycurl
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    ImportError: pycurl: libcurl link-time version (7.79.1) is older than compile-time version (7.86.0)
    >>> quit()


    PS:


    1. poetry env info --path does return the correct poetry virtual env path.


    2. I tried switching my Python version to 3.8.X and 3.9.X and still having the same issue.


    3. I also updated my curl version to 7.86 using brew and doing a brew --version does conform the same.

    $ curl --version  ✔  at 11:13:19 pm  ▓▒░
    curl 7.86.0 (aarch64-apple-darwin21.6.0) libcurl/7.86.0 (SecureTransport) OpenSSL/1.1.1s zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.4 libssh2/1.10.0 nghttp2/1.51.0 librtmp/2.3
    Release-Date: 2022-10-26
    Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
    Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL threadsafe TLS-SRP UnixSockets zstd


    What am I missing from the above steps? Thank you in advance for your time... :)

    Continue reading...

Compartilhe esta Página