Skip to content

incompatibility with the latest version of lightning utilities #3039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
SteelMarley opened this issue Apr 15, 2025 · 0 comments
Open

incompatibility with the latest version of lightning utilities #3039

SteelMarley opened this issue Apr 15, 2025 · 0 comments

Comments

@SteelMarley
Copy link

Hi! Just a heads-up — the Colab version of the AUTOMATIC1111 notebook is currently broken due to an incompatibility with the latest version of lightning_utilities.

The error is caused by a missing ModuleAvailableCache in lightning_utilities.core.imports — this function seems to have been removed in newer versions. Downgrading to lightning-utilities==0.9.0 fixes the issue.

Everything was working fine until yesterday. Maybe consider pinning the package version in the notebook to avoid future breakage?

Thanks for the great work 🙏

Hey everyone,

For those using TheLastBen’s Colab notebook for Stable Diffusion (AUTOMATIC1111) and suddenly getting import errors like:

ImportError: cannot import name 'ModuleAvailableCache' from 'lightning_utilities.core.imports'
Or errors involving pytorch_lightning, wandb, etc...

It’s because some core dependencies auto-updated and broke compatibility.

✅ TEMP FIX (Colab):
Run this before starting webui.py:

!pip uninstall -y lightning-utilities pytorch-lightning torchmetrics wandb
!pip install lightning-utilities==0.9.0
!pip install pytorch_lightning==1.9.4
!pip install torchmetrics==0.11.4
!pip install wandb==0.15.12

Also, if needed, patch these 2 files to avoid annoying warnings:

!sed -i 's@from pytorch_lightning.loggers.wandb import WandbLogger # noqa: F401@@g' /usr/local/lib/python3.11/dist-packages/pytorch_lightning/loggers/init.py
!sed -i 's@from .mailbox import ContextCancelledError@@g' /usr/local/lib/python3.11/dist-packages/wandb/sdk/lib/retry.py
!sed -i 's@raise ContextCancelledError("retry timeout")@print("retry timeout")@g' /usr/local/lib/python3.11/dist-packages/wandb/sdk/lib/retry.py
This brought everything back to normal for me.
Hope it helps while we wait for a clean fix in the repo. 🙏

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant