Skip to content

Lazy load matplotlib to avoid import locks #739

Open
@PhilipVinc

Description

@PhilipVinc

On a SLURM cluster I've seen some hangs due to igraph loading matplotlib

TimeoutError: Lock error: Matplotlib failed to acquire the following lock file:
    /dev/shm/.cache-sdash/matplotlib/fontlist-v330.json.matplotlib-lock
This maybe due to another process holding this lock file.  If you are sure no
other Matplotlib process is running, remove this file and try again.
    with cbook._lock_path(filename), open(filename, 'w') as fh:
  File "/mnt/sw/nix/store/gpkc8q6zjnp3n3h3w9hbmbj6gjbxs85w-python-3.10.10-view/lib/python3.10/contextlib.py", line 135, in __enter__
    raise TimeoutError("""\

Unfortunately, it is not under my power to uninstall matplotlib because it is installed in some shared space. Ideally, igraph would load it lazily only if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions