After this lesson, you can
- Create a project folder.
- Create and activate .venv.
- Install packages through the active interpreter.
1. Why use an environment?
A virtual environment is a separate package space for one course or project. It prevents unrelated projects from changing each other's package versions.
2. Create the folder and environment
Create the project folder
mkdir ceteris-python
cd ceteris-pythonWindows
py -m venv .venvmacOS or Linux
python3 -m venv .venv3. Activate it
Windows PowerShell
.venv\Scripts\Activate.ps1Windows Command Prompt
.venv\Scripts\activate.batmacOS or Linux
source .venv/bin/activate4. Upgrade pip safely
python -m pip makes it clear which Python environment receives the package.
Use the active interpreter
python -m pip install --upgrade pipYour setup progress