UV is an extremely fast Python package installer and resolver, written in Rust. It's designed as a drop-in replacement for pip and pip-tools, offering significant performance improvements for package installation and dependency resolution.
- Speed: 10-100x faster than pip for package installation and dependency resolution
- Reliable: Consistent dependency resolution with a robust resolver
- Drop-in Replacement: Compatible with pip commands and workflows
- Disk Space Efficient: Uses a global cache to avoid redundant downloads
- Better Error Messages: Provides clearer feedback when dependency conflicts occur
- Modern: Built with modern Rust tooling for performance and reliability
Install UV using Homebrew:
brew install uvOr using curl:
curl -LsSf https://astral.sh/uv/install.sh | shOr using pip:
pip install uvUsing curl:
curl -LsSf https://astral.sh/uv/install.sh | shOr using pip:
pip install uvOr using pipx (recommended for system-wide installation):
pipx install uvUsing PowerShell:
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"Or using pip:
pip install uvOr using Scoop:
scoop install uvAfter installation, verify that UV is installed correctly:
uv --versionReplace pip with uv pip in your commands:
# Install a package
uv pip install package-name
# Install from requirements.txt
uv pip install -r requirements.txt
# Install in a virtual environment
uv venv --python 3.12
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install package-nameFirst, create a virtual environment using UV:
uv venv --python 3.12This creates a .venv directory in your project.
On macOS/Linux:
source .venv/bin/activateOn Windows:
.venv\Scripts\activateInstall Jupyter Notebook using UV:
uv pip install notebookOr install JupyterLab (modern interface):
uv pip install jupyterlabAlternative: Install All Dependencies at Once
If you have a requirements.txt file with all your project dependencies, you can install everything in one command:
uv pip install -r requirements.txtThis will install Jupyter, data science libraries, deep learning frameworks, and visualization tools all together.
To use your virtual environment as a kernel in Jupyter Notebook, install and register it:
# Install ipykernel
uv pip install ipykernel
# Register the kernel with Jupyter
python -m ipykernel install --user --name=mlforeverything --display-name="Python (MLForEverything)"This creates a kernel named "mlforeverything" that will appear in Jupyter's kernel selection menu.
Parameters explained:
--user: Installs the kernel for the current user only--name: Internal name for the kernel (used in kernel specs)--display-name: Name shown in Jupyter's interface
Start Jupyter Notebook:
jupyter notebookOr start JupyterLab:
jupyter labThis will open Jupyter in your default web browser at http://localhost:8888.
When creating a new notebook, select "Python (MLForEverything)" from the kernel menu.
List all installed kernels:
jupyter kernelspec listRemove a kernel:
jupyter kernelspec remove mlforeverythingChange to a different kernel in a running notebook:
Go to Kernel → Change Kernel in the Jupyter Notebook menu.
You can also use UV to run Jupyter without explicitly installing it first:
uv run jupyter notebookThis automatically installs Jupyter in an isolated environment and runs it.
Once your virtual environment is active, you can install additional packages for your notebooks:
Option 1: Install from requirements.txt (Recommended)
uv pip install -r requirements.txtOption 2: Install packages individually
# Install data science packages
uv pip install numpy pandas matplotlib seaborn scikit-learn
# Install deep learning frameworks
uv pip install torch tensorflow
# Install visualization libraries
uv pip install plotly bokeh altairTo stop the Jupyter server, press Ctrl+C in the terminal where it's running.