Skip to content

Instantly share code, notes, and snippets.

@gpetrousov
Created August 12, 2026 11:19
Show Gist options
  • Select an option

  • Save gpetrousov/0526a3a08775bee99e9688b1808db5da to your computer and use it in GitHub Desktop.

Select an option

Save gpetrousov/0526a3a08775bee99e9688b1808db5da to your computer and use it in GitHub Desktop.
jupyter environment bootstrap script
#!/bin/bash
set -e
PROJECT_NAME=${1:-"jupyter_notebooks"}
echo "Creating project: $PROJECT_NAME..."
mkdir -p "$PROJECT_NAME"
cd "$PROJECT_NAME"
# Init project dependency tracking w/o package boilerplate
uv init -p 3.11.4 --no-package
echo "Configuring PyTorch index for CUDA 12.4..."
cat << 'EOF' >> pyproject.toml
[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true
[tool.uv.sources]
torch = { index = "pytorch-cu124" }
torchvision = { index = "pytorch-cu124" }
torchaudio = { index = "pytorch-cu124" }
EOF
echo "Adding dependencies and generating lockfile..."
uv add torch torchvision torchaudio ipykernel
echo "Setup complete!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment