Lightning-AI/pytorch-lightning · error · RuntimeError

NeptuneLogger is no longer supported. Neptune has been sunse

Error message

NeptuneLogger is no longer supported. Neptune has been sunset.

Please migrate to LitLogger, the recommended logger for AI experiments.
See: https://github.com/lightning-ai/litlogger

What it means

Neptune (the managed experiment-tracking service) was sunset, and Lightning's NeptuneLogger now unconditionally raises RuntimeError in __init__. The message directs users to LitLogger as the replacement. This is a deliberate removal, not a runtime fault.

Source

Thrown at src/lightning/pytorch/loggers/neptune.py:40


class NeptuneLogger:
    """
    .. deprecated:: Use :class:`LitLogger` instead.

    Neptune has been sunset and this logger is no longer maintained.
    Please migrate to **LitLogger**, the recommended logging solution for
    tracking AI experiments, metrics, inputs, outputs, and artifacts.

    See: https://github.com/Lightning-AI/LitLogger

    Raises:
        RuntimeError: Always raised when attempting to instantiate this logger.
    """

    def __init__(self, *args: Any, **kwargs: Any) -> None:
        """Raise an error indicating Neptune logger is no longer supported."""
        raise RuntimeError(
            "NeptuneLogger is no longer supported. Neptune has been sunset.\n"
            "\n"
            "Please migrate to LitLogger, the recommended logger for AI experiments.\n"
            "See: https://github.com/lightning-ai/litlogger\n"
        )

View on GitHub (pinned to 9fed5c27d2)

Solutions

  1. Migrate to LitLogger: https://github.com/lightning-ai/litlogger
  2. Or use another supported logger (MLFlowLogger, WandbLogger, TensorBoardLogger, CSVLogger)
  3. Pin an older lightning version only as a temporary stopgap while migrating

Example fix

# before
from lightning.pytorch.loggers.neptune import NeptuneLogger
logger = NeptuneLogger(api_token=..., project=...)
# after
from lightning.pytorch.loggers.litlogger import LitLogger
logger = LitLogger(...)
Defensive patterns

Strategy: type-guard

Validate before calling

try:
    from lightning.pytorch.loggers.neptune import NeptuneLogger
except ImportError:
    NeptuneLogger = None
if NeptuneLogger is not None:
    logger = NeptuneLogger(...)  # will raise — migrate instead

Type guard

def make_logger(name: str, **kw):
    if name == "neptune":
        raise RuntimeError("Neptune is sunset; use LitLogger")
    return LOGGER_REGISTRY[name](**kw)

Prevention

When it happens

Trigger: Any attempt to instantiate lightning.pytorch.loggers.neptune.NeptuneLogger(...) regardless of arguments or environment.

Common situations: Old training scripts or tutorials referencing NeptuneLogger; upgrading Lightning to a version containing the removal while code still imports/instantiates the logger.

Related errors


AI-assisted analysis of Lightning-AI/pytorch-lightning@9fed5c27d2 (2026-08-28). Data as JSON: /api/errors/9a0381662b70c2e2. Report an issue: GitHub.