2. Set Up Your Development Environment
Duration2h30 AI Banned
Introduction
In this activity, you will prepare the development environment used throughout the course. You do not need an existing Python installation: uv will manage Python later, inside each project. Windows users will work in Ubuntu through WSL, while macOS and Linux users will use their native terminal. Everyone will use VS Code with the Python and Jupyter extensions.
Windows users
Do not install Python, Git, or uv directly in Windows for this course. Install and run them inside Ubuntu on WSL. VS Code itself remains a Windows application and connects to the Linux environment through the WSL extension.
Choose your platform
- If you use Windows, follow Windows: Install WSL and VS Code.
- If you use macOS or Linux, go directly to macOS and Linux Setup.
- Everyone must then complete Install uv and Final Validation.
Windows: Install WSL and VS Code
Install Ubuntu with WSL
Open PowerShell as Administrator and run:
|
|
Restart Windows if requested, launch Ubuntu from the Start menu, and create your Linux username and password. The password is not displayed while you type; this is normal.
In the Ubuntu terminal, update the package list and install the command-line tools required by the course:
|
|
Check that the commands are available:
|
|
Checkpoint 1
Run uname -a in the Ubuntu terminal. The output must mention Linux and Microsoft or WSL. Do not continue from PowerShell or Command Prompt.
Install Visual Studio Code
Download and install Visual Studio Code on Windows using the default options. In VS Code, install these Microsoft extensions:
- WSL
- Python
- Pylance
- Jupyter
Create a Linux workspace
Return to the Ubuntu terminal and create a directory for the course inside your Linux home directory:
|
|
VS Code should reopen connected to WSL. Look for the WSL indicator in the bottom-left corner, then open Terminal → New Terminal.
Run these commands in the integrated terminal:
|
|
The path must start with /home/, not /mnt/c/, and the terminal must report a Linux environment.
Keep the project inside WSL
Do not create the course project in C:\Users\... or /mnt/c/.... Keeping code and environments in the WSL filesystem avoids performance, permission, path, and kernel-detection problems.
Checkpoint 2
VS Code displays the WSL indicator, its integrated terminal reports a path under /home/, and git --version works in that terminal.
macOS and Linux Setup
Install Visual Studio Code and add the Microsoft Python, Pylance, and Jupyter extensions. Make sure Git and curl are available in your terminal:
|
|
Create and open the course workspace:
|
|
Open the VS Code integrated terminal and verify that it points to the same directory:
|
|
Checkpoint
The VS Code terminal displays your data-science-toolkit directory and both git --version and curl --version succeed.
Install uv
Run the official installer in the VS Code terminal. Under Windows, this terminal must still be connected to WSL.
|
|
Close and reopen the terminal, then verify the installation:
|
|
If uv is not found, reload your shell configuration and try again:
|
|
On macOS with zsh, use source ~/.zshrc instead.
Why uv?
uv will install the Python version required by a project, create its isolated .venv environment, resolve dependencies, create a reproducible lockfile, and run commands in that environment. You will use these capabilities one at a time in the next activity.
Final Validation
Run all of the following commands in the VS Code integrated terminal:
|
|
Windows users must also run:
|
|
Activity complete
Continue only when every command succeeds. Windows users must additionally confirm that VS Code is connected to WSL and that the current path is inside /home/.
Troubleshooting
code is not available in WSL
Open VS Code on Windows, install the WSL extension, open the Command Palette with Ctrl+Shift+P, and select WSL: Connect to WSL. Then reopen the Ubuntu terminal and try code . again.
VS Code opened the folder locally on Windows
Click the remote indicator in the bottom-left corner and select Reopen Folder in WSL. Check pwd again in a new integrated terminal.
uv is still not found
Open a new terminal, reload .bashrc or .zshrc, and inspect the final messages printed by the uv installer. Do not install a second copy in another operating system.
WSL installation is blocked
Record the complete error message and ask the instructor for help. Do not replace the course environment with an unrelated Python installation, because later instructions assume Linux paths and commands.