Environment Setup Guide¶
Last Updated: 2026-10-27
Reading Time: 15 minutes
Difficulty: ⭐ Beginner
Overview¶
This guide helps you set up a complete AI development environment for Minder Academy. Whether you're working on Windows, Mac, or Linux, we'll get you ready to run local LLMs, fine-tune models, and deploy AI systems.
Hardware Requirements¶
Minimum Specifications (For Learning)¶
| Component | Minimum | Recommended | Notes |
|---|---|---|---|
| CPU | 4 cores | 8+ cores | x86_64 or ARM64 |
| RAM | 16GB | 32GB+ | More RAM = better model performance |
| Storage | 100GB SSD | 500GB+ NVMe SSD | Models take significant space |
| GPU | None (CPU mode) | 8GB+ VRAM | NVIDIA RTX 3060+ recommended |
| Network | Stable internet | 100Mbps+ | For model downloads |
Check Your Hardware¶
Windows:
# System Information
systeminfo | findstr /C:"Total Physical Memory"
# GPU Information (if NVIDIA)
nvidia-smi
# Storage Check (wmic was removed in Windows 11 24H2)
Get-CimInstance Win32_DiskDrive | Select-Object Model,Size
Mac/Linux:
# System Information
system_profiler SPHardwareDataType # Mac
lscpu # Linux
# GPU Information
nvidia-smi # If NVIDIA
# Storage Check
df -h
Software Installation¶
Step 1: Operating System Preparation¶
Windows¶
-
Enable WSL2 (Recommended for AI development)
wsl --install -
Install Windows Terminal (from Microsoft Store)
-
Enable Virtualization in BIOS:
- Intel: Intel VT-x
- AMD: AMD-V
macOS¶
- Update macOS to latest version
- Install Xcode Command Line Tools:
xcode-select --install
Linux (Ubuntu/Debian)¶
sudo apt update
sudo apt upgrade -y
sudo apt install -y build-essential curl wget git
Step 2: Docker Installation¶
Docker is essential for containerized AI applications.
Windows¶
- Download Docker Desktop from docker.com
- Run installer with WSL2 backend enabled
- Restart computer
- Verify installation:
docker --version docker run hello-world
macOS¶
- Download Docker Desktop for Mac (Apple Silicon or Intel)
- Install and start Docker
- Verify:
docker --version docker run hello-world
Linux¶
# Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Add user to docker group
sudo usermod -aG docker $USER
# Verify
docker --version
If you added yourself to the docker group, sign out and back in before
running Docker without sudo. This group grants root-level privileges; only
add trusted administrators. For a daemon that runs without root privileges,
consider Docker rootless mode.
Step 3: Python Environment (uv)¶
Tooling standard (2026): this curriculum uses uv as its package manager. uv resolves and installs packages 10-100x faster than pip (parallel downloads + a global cache) and manages Python versions, virtual environments, and project dependencies in one tool. Everywhere else in the corpus, a
pip install Xyou encounter maps 1:1 touv pip install X.Two deliberate exceptions: inside conda workflows,
pip installinto the active environment remains the standard; and in uv-first blocks that already showuv pip installas the recommended form, a labeled plain-pip fallback (QUICK-START's# plain pip works too) may stay so first-run readers succeed on any setup. Dockerfiles used to be a third exception, but every Dockerfile in the corpus now follows LAB-001's official uv image pattern (uv binary copied from the uv image, thenRUN uv pip install --system); TUTORIAL-002 keeps one deliberately bad Dockerfile that uses plain pip as a labeled anti-example.
Install uv¶
Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
Verify:
uv --version
Prefer pip? uv is a drop-in replacement, but a system Python 3.13 with
python -m venvand plainpipstill works for every lesson. On Windows, install Python from python.org (check "Add Python to PATH"); on macOS usebrew install python@3.13. On Linux, install Python 3.13 from your distribution if available, or let uv manage it withuv python install 3.13(recommended). Package names and available Python versions vary by distribution release.
Create the Project Environment¶
macOS / Linux:
mkdir -p "$HOME/academy"
cd "$HOME/academy"
Windows PowerShell:
New-Item -ItemType Directory -Force "$HOME\academy" | Out-Null
Set-Location "$HOME\academy"
Create the same virtual environment on any platform; uv downloads Python 3.13 if it is missing:
uv venv --python 3.13
Activation is optional because uv finds .venv from the project directory.
If you use a shell that needs activation:
# macOS / Linux
source .venv/bin/activate
# Windows PowerShell
.\.venv\Scripts\Activate.ps1
:: Windows Command Prompt
.venv\Scripts\activate.bat
uv Project Workflow (pyproject.toml + uv.lock)¶
The uv pip interface above is the pip-compatible layer. For projects,
declare dependencies in pyproject.toml and pin them with uv.lock so
machines and CI use reproducible versions.
# Start a project (creates pyproject.toml + .venv automatically)
uv init --python 3.13
# Declare a dependency (writes it to pyproject.toml and updates
# uv.lock in one step)
uv add fastapi uvicorn
# Install exactly what uv.lock pins (run this after cloning)
uv sync
# Run project commands inside the managed environment
# (no activate needed - uv picks up .venv by itself)
uv run uvicorn main:app --reload
How the two layers relate:
uv pip install -r requirements.txt— imperative, like pip; fine for labs and one-off installsuv add/uv sync+uv.lock— declarative and reproducible across machines and CI; the standard for anything you own- Migrating an existing
requirements.txt:uv add -r requirements.txtimports it intopyproject.tomlin one step
Code Quality Tooling (ruff, zero-install via uvx)¶
For linting and formatting, ruff combines linting and formatting in one fast tool. You do not even need to install it: uvx runs a tool in an ephemeral, cached environment.
# Lint and format the project - no install step at all
uvx ruff check .
uvx ruff format .
# Use it daily? Install it once into an isolated tool environment
uv tool install ruff
Windows Console Encoding (UTF-8 Mode)¶
This curriculum's example code prints Unicode symbols (✓, →, 🚀). Interactive terminals on Windows already display these, but any output that is piped or redirected — python train.py > log.txt, CI logs, tool capture — still uses the legacy locale code page (e.g. cp1252) by default, so those prints can raise UnicodeEncodeError: 'charmap' codec can't encode character ....
Enable Python's UTF-8 mode once and every lesson prints cleanly:
# Windows (per-user, permanent)
setx PYTHONUTF8 1
# ...then open a NEW terminal so the variable is picked up
# macOS / Linux are usually UTF-8 already; setting it is harmless
export PYTHONUTF8=1
UTF-8 mode (PEP 540) also makes file reads and writes default to UTF-8, and it becomes the default behavior in Python 3.15 (PEP 686) — setting PYTHONUTF8=1 today is just adopting tomorrow's standard early. uv run passes the environment through, so the setting applies to project commands too.
Step 4: Ollama Installation¶
Ollama simplifies running local LLMs.
Windows (WSL2)¶
# Install in WSL2
curl -fsSL https://ollama.com/install.sh | sh
macOS¶
# Download installer from ollama.com
# OR use Homebrew
brew install ollama
Linux¶
curl -fsSL https://ollama.com/install.sh | sh
Start Ollama & Test¶
# Start Ollama server
ollama serve
# In another terminal, pull a model
ollama pull mistral:7b
# Test chat
ollama run mistral:7b "Hello, can you help me learn AI?"
Step 5: Essential Python Packages¶
# Core AI/ML packages
uv pip install torch torchvision torchaudio
uv pip install transformers
uv pip install datasets
uv pip install accelerate
# RAG and vector databases
uv pip install chromadb qdrant-client
uv pip install langchain
uv pip install sentence-transformers
# Fine-tuning
uv pip install peft
uv pip install bitsandbytes
uv pip install trl
# Utilities
uv pip install jupyter
uv pip install pandas numpy matplotlib
uv pip install requests tqdm
NVIDIA GPU? Choose your OS, Python version, and compute platform in PyTorch's current install selector, then run its generated command. To use uv, replace
pipwithuv pipand keep the selector's CUDA index and version pins. Driver and wheel support vary by GPU and PyTorch release, so avoid copying a fixed CUDA wheel URL from an older guide.
Troubleshooting¶
Issue 1: Ollama Download Fails¶
Symptoms:
- Download hangs at 0%
- "Connection refused" error
- Very slow download speed
Solutions:
-
Check Network Connection:
# Test internet ping google.com # Check DNS nslookup ollama.com -
Use Alternative Mirror:
# Set environment variable export OLLAMA_HOST=https://ollama.com -
Pull the model via the CLI:
# Pull the model with the ollama CLI (page: https://ollama.com/library/mistral) ollama pull mistral:7b # Place in Ollama models directory # ~/.ollama/models/ on Linux/Mac # %USERPROFILE%\.ollama\models\ on Windows
Issue 2: Docker "Permission Denied"¶
Linux only:
# Check whether Docker works with administrator privileges
sudo docker ps
If that works, sign out and back in if you have just joined the docker group.
Membership grants root-level privileges, so add only trusted administrators.
For a daemon that runs without root privileges, use
Docker rootless mode.
Do not make /var/run/docker.sock world-writable; that gives every local user
control of the Docker daemon. See Docker's Linux post-installation steps
for the full setup guidance.
Issue 3: CUDA Out of Memory (GPU)¶
Symptoms:
- "CUDA out of memory" error
- Model fails to load
Solutions:
-
Check GPU Memory:
nvidia-smi -
Use Smaller Model:
# Try 7B instead of 13B/70B ollama pull mistral:7b -
Offload to CPU:
import torch # Force CPU device = "cpu" model.to(device)
Issue 4: Python Version Conflicts¶
Symptoms:
- "Module not found" errors
- Version incompatibility
Solutions:
-
Check Python Version:
python --version # Use Python 3.13, the repository baseline; check a lesson's dependency support before using a newer release -
Use uv (recommended) or pyenv:
# uv manages interpreter versions too - simplest path uv python install 3.13 uv venv --python 3.13 # pyenv alternative (Mac/Linux) brew install pyenv # Mac curl https://pyenv.run | bash # Linux # Install Python 3.13 pyenv install 3.13 pyenv local 3.13 -
Windows - Use Python Launcher with uv:
py -3.13 --version uv pip install --python 3.13 package-name
Issue 5: WSL2 Issues on Windows¶
Symptoms:
- WSL won't start
- Network issues between WSL and Windows
Solutions:
-
Update WSL:
wsl --update -
Restart WSL:
wsl --shutdown wsl -
Check Network Bridge:
# In PowerShell (admin) New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
Issue 6: UnicodeEncodeError: 'charmap' codec on Windows¶
Symptoms:
UnicodeEncodeError: 'charmap' codec can't encode character '✓'- Example code that prints symbols or emoji (
✓,→,🚀) crashes only when the output is piped, redirected to a file, or captured by a tool — the same code works when typed interactively
Solutions:
-
Enable UTF-8 mode (recommended, permanent):
setx PYTHONUTF8 1 # Open a new terminal, then verify: python -c "print('✓ unicode ok')" -
One-off for a single run:
python -X utf8 your_script.py
This is Windows legacy output encoding, not a bug in the lesson code — see the Windows Console Encoding section in Step 3 for the background.
Verification Checklist¶
Before starting tutorials, verify:
Hardware Verification¶
- RAM meets minimum (16GB+)
- Storage space available (100GB+)
- GPU detected (if available) with
nvidia-smi
Software Verification¶
- Docker running:
docker ps - uv installed:
uv --version - Virtual environment active. Verify it in your shell:
- macOS/Linux:
which python - PowerShell:
Get-Command python - Command Prompt:
where python - uv also finds
.venvwhen run from the project directory - Ollama running:
ollama list - Model downloaded:
ollama pull mistral:7b
Functionality Verification¶
- Can run Docker container:
docker run hello-world - Can import PyTorch:
python -c "import torch" - Can chat with model:
ollama run mistral:7b "test" - Can create notebook:
jupyter notebook
Next Steps¶
Once your environment is set up:
- Start with Quick Start: QUICK-START.md
- Complete LAB-000: LAB-000-ENVIRONMENT-SETUP.md
- Progress to TUTORIAL-001: TUTORIAL-001-Hello-LLM.md
Additional Resources¶
Hardware Guides¶
Software Resources¶
Troubleshooting¶
Tips for Success¶
- Start Small: Begin with 7B models, not 70B
- Use Virtual Environments: Avoid package conflicts
- Monitor Resources: Use
htopornvidia-smi - Backup Models: Don't re-download large models
- Document Setup: Note your working configuration
Still having issues? Check TROUBLESHOOTING-QUICKSTART.md for common Quick Start problems.