Installation ============ Requirements ------------ PyTorch Lightning requires: * Python 3.9 or later * PyTorch 2.0 or later * CUDA 11.8+ (optional, for GPU acceleration) Install from PyPI ----------------- The recommended way to install PyTorch Lightning: .. code-block:: bash pip install lightning This installs the unified ``lightning`` package which includes ``lightning.pytorch``. To install the standalone PyTorch Lightning package: .. code-block:: bash pip install pytorch-lightning Install with extras ~~~~~~~~~~~~~~~~~~~ .. code-block:: bash # Weights & Biases integration pip install "lightning[wandb]" # MLflow integration pip install "lightning[mlflow]" # All optional integrations pip install "lightning[extra]" Install from source ------------------- .. code-block:: bash git clone https://github.com/Lightning-AI/pytorch-lightning.git cd pytorch-lightning pip install -e ".[dev]" Verifying installation ---------------------- .. code-block:: python import lightning as L print(L.__version__) # 2.4.0 import lightning.pytorch as pl print(pl.__version__) # 2.4.0 Docker ------ An official Docker image is available: .. code-block:: bash docker pull pytorchlightning/pytorch_lightning:base-cuda-py3.11-torch2.4 docker run --gpus all -it pytorchlightning/pytorch_lightning:base-cuda-py3.11-torch2.4 .. note:: When using Docker with GPU support, ensure the NVIDIA Container Toolkit is installed on the host machine.