{"record":{"id":"150d76109d9f495a","repo":"Lightning-AI/pytorch-lightning","slug":"starting-from-v1-9-0-tensorboardx-has-been-remo","errorCode":null,"errorMessage":"Starting from v1.9.0, `tensorboardX` has been removed as a dependency of the `lightning.pytorch` package, due to potential conflicts with other packages in the ML ecosystem. For this reason, `logger=True` will use `CSVLogger` as the default logger, unless the `tensorboard` or `tensorboardX` packages are found. Please `pip install lightning[extra]` or one of them to enable TensorBoard support by default","messagePattern":"Starting from v1\\.9\\.0, `tensorboardX` has been removed as a dependency of the `lightning\\.pytorch` package, due to potential conflicts with other packages in the ML ecosystem\\. For this reason, `logger=True` will use `CSVLogger` as the default logger, unless the `tensorboard` or `tensorboardX` packages are found\\. Please `pip install lightning\\[extra\\]` or one of them to enable TensorBoard support by default","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/lightning/pytorch/trainer/connectors/logger_connector/logger_connector.py","lineNumber":76,"sourceCode":"            # `+ 1` because it can be checked before a step is executed, for example, in `on_train_batch_start`\n            step = loop.epoch_loop._batches_that_stepped + 1\n        elif isinstance(loop, (pl.loops._EvaluationLoop, pl.loops._PredictionLoop)):\n            step = loop.batch_progress.current.ready\n        else:\n            raise NotImplementedError(loop)\n        should_log = step % trainer.log_every_n_steps == 0\n        return should_log or trainer.should_stop\n\n    def configure_logger(self, logger: Union[bool, Logger, Iterable[Logger]]) -> None:\n        if not logger:\n            # logger is None or logger is False\n            self.trainer.loggers = []\n        elif logger is True:\n            # default logger\n            if _TENSORBOARD_AVAILABLE or _TENSORBOARDX_AVAILABLE:\n                logger_ = TensorBoardLogger(save_dir=self.trainer.default_root_dir, version=SLURMEnvironment.job_id())\n            else:\n                warning_cache.warn(\n                    \"Starting from v1.9.0, `tensorboardX` has been removed as a dependency of the `lightning.pytorch`\"\n                    \" package, due to potential conflicts with other packages in the ML ecosystem. For this reason,\"\n                    \" `logger=True` will use `CSVLogger` as the default logger, unless the `tensorboard`\"\n                    \" or `tensorboardX` packages are found.\"\n                    \" Please `pip install lightning[extra]` or one of them to enable TensorBoard support by default\"\n                )\n                logger_ = CSVLogger(save_dir=self.trainer.default_root_dir)  # type: ignore[assignment]\n            self.trainer.loggers = [logger_]\n        elif isinstance(logger, Iterable):\n            self.trainer.loggers = list(logger)\n        else:\n            self.trainer.loggers = [logger]\n\n        if (\n            not any(isinstance(logger, LitLogger) for logger in self.trainer.loggers)\n            and self.trainer.suggest_integrations\n        ):\n            rank_zero_info(","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/Lightning-AI/pytorch-lightning/blob/9fed5c27d2a62ff0efd6c3573599921d6ff67c14/src/lightning/pytorch/trainer/connectors/logger_connector/logger_connector.py#L58-L94","documentation":"Since v1.9.0 tensorboardX is not a dependency of lightning.pytorch. If Trainer(logger=True) (the default) finds neither tensorboard nor tensorboardX installed, it warns and falls back to CSVLogger.","triggerScenarios":"Fresh install of lightning without extras; Trainer() with defaults; then checking logs expecting TensorBoard event files.","commonSituations":"CI environments or slim Docker images without tensorboard; upgrading Lightning and finding logs as CSV instead of tfevents.","solutions":["pip install lightning[extra] or pip install tensorboard tensorboardX to get TensorBoardLogger by default","Or explicitly pass logger=TensorBoardLogger(...) / CSVLogger(...) to remove ambiguity","Point tensorboard at the CSV fallback or use the CSV logs directly"],"exampleFix":"# before\ntrainer = Trainer()  # warns, uses CSVLogger\n# after\n# pip install lightning[extra]\ntrainer = Trainer(logger=TensorBoardLogger('logs'))","handlingStrategy":"validation","validationCode":"try:\n    import tensorboard  # noqa\n    tb = True\nexcept ImportError:\n    tb = False\nlogger = TensorBoardLogger('logs') if tb else CSVLogger('logs')\ntrainer = Trainer(logger=logger)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass an explicit logger instead of relying on logger=True","Install lightning[extra] in images that expect TensorBoard"],"tags":["logger","tensorboard","csv-fallback","lightning","version-change"],"backgroundTag":"default-logger-fallback","analyzedSha":"9fed5c27d2a62ff0efd6c3573599921d6ff67c14","analyzedAt":"2026-08-28T11:52:41.083Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}