Skip to content

Conflict with libcurl with ecckitlib >= 1.29.2 and pycurl #140

@OlivierPG

Description

@OlivierPG

What happened?

Starting with eckitlib 1.29.2, using eccodes can cause a version conflict on the libcurl library.
The packaged libeccodes is linked against an ancient libcurl version. If it get loaded first, it create an error down the line when another library wants to load libcurl but was linked against a newer version.

ImportError: pycurl: libcurl link-time version (7.61.1) is older than compile-time version (8.16.0-DEV)

While the issue is exposed by ecckitlib, I believe the core problem lies in libeccodes linking against very old libcurl version.
As far as I know, libcurl should be backward compatible, so there shouldn't be a problem with compatibility using a new version of the library.

What are the steps to reproduce the bug?

I made a small toy example that should demonstrate the issue (on Linux at least):

import eccodes
import eckitlib
import pycurl

def main():
    print("eckitlib version:", eckitlib.__version__)
    print("pycurl version:", pycurl.version)
    print("eccodes version:", eccodes.__version__)

if __name__ == "__main__":
    main()

Then run (using uv) with different version of the eckitlib library:
uv run --with pycurl --with eckitlib==1.28.4 --with eccodes python main.py --> works
uv run --with pycurl --with eckitlib==1.29.2 --with eccodes python main.py --> will NOT work
uv run --with pycurl --with eckitlib --with eccodes python main.py --> will NOT work
FINDLIBS_DISABLE_PACKAGE=yes uv run --with pycurl --with eckitlib --with eccodes python main.py --> works with eccodes installed in the system

Note that changing the import order of the above example works:

import eckitlib
import pycurl
import eccodes

eccodes is now last in the import order, meaning it will use the newer version of libcurl loaded by the other libraries.

Version

v2.44.0.4

Platform (OS and architecture)

Linux Fedora 42 & Ubuntu 24.04

Relevant log output

/home/opelgrin/.cache/uv/archive-v0/ZMoMcriND6AU6jh8mBvFJ/lib/python3.13/site-packages/gribapi/__init__.py:23: UserWarning: ecCodes 2.42.0 or higher is recommended. You are running version 2.39.2
  warnings.warn(
eckitlib version: 1.28.4
pycurl version: PycURL/7.45.7 libcurl/8.16.0-DEV OpenSSL/3.5.3 zlib/1.3.1.zlib-ng brotli/1.1.0 libssh2/1.11.1_DEV nghttp2/1.67.1
eccodes version: 2.39.2

Traceback (most recent call last):
  File "/home/opelgrin/code/zoos/pycurl-test/main.py", line 3, in <module>
    import pycurl
ImportError: pycurl: libcurl link-time version (7.61.1) is older than compile-time version (8.16.0-DEV)

Traceback (most recent call last):
  File "/home/opelgrin/code/zoos/pycurl-test/main.py", line 3, in <module>
    import pycurl
ImportError: pycurl: libcurl link-time version (7.61.1) is older than compile-time version (8.16.0-DEV)

eckitlib version: 1.32.2.4
pycurl version: PycURL/7.45.7 libcurl/8.16.0-DEV OpenSSL/3.5.3 zlib/1.3.1.zlib-ng brotli/1.1.0 libssh2/1.11.1_DEV nghttp2/1.67.1
eccodes version: 2.44.0

Accompanying data

No response

Organisation

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions