Install Python and create a separate virtual environment for your practice project. This keeps packages for one project separate from packages used by another.
What you need
- Python from python.org
- A terminal and a code editor
- A project folder named python-practice
Set up your environment
- Install a supported Python release using the official instructions for your operating system. Close and reopen the terminal.
- Check
python --version. On some systems usepython3; Windows may also provide thepylauncher. - Inside your project run
python -m venv .venv. On Windows you can run its interpreter directly as.venv\Scripts\python.exe. On Linux/macOS use.venv/bin/python. - Create
hello.py. In VS Code, choose the virtual environment as the project interpreter.
Your first check
Save as hello.py
name = 'Teacher'
print(f'Hello, {name}!')Run or verify
Windows: .venv\Scripts\python.exe hello.py
Linux/macOS: .venv/bin/python hello.pyExpected result: Hello, Teacher! is printed.
Common setup problems
- If Python is not found, reopen the terminal and check the official installation instructions.
- Use the selected interpreter with
-m pipwhen installing packages, so packages go into the intended environment.
Official documentation
Guide reviewed 17 November 2026. Check the linked vendor documentation for current supported versions and operating systems.