📝 Tools

Setting Up Your Environment: Python, pip, and VS Code

0
Author
04e5cc8b-58ac-4bdc-bdee-661bbb
📅
Published
04.06.2026
⏱️
Reading time
2 min
👁️
Views
16
🌱
Level
Beginner

Before writing code locally, you need to set up three tools: Python, pip, and VS Code. This takes 10–15 minutes and only needs to be done once.


1. Installing Python

Windows

  1. Go to python.org/downloads and download the latest stable version (3.10+)
  2. Run the installer
  3. Important: Check the Add Python to PATH checkbox on the first screen — without it, Python won’t be accessible from the terminal
  4. Click Install Now

Verify after installation — open PowerShell and run:

python --version

macOS

Most Macs come with Python 2, but we need Python 3. Check what you have:

python3 --version

If the version is 3.10+ — you’re good to go. If not, install it via Homebrew:

brew install python3

Or download the installer from python.org (choose the macOS installer).

Linux (Ubuntu/Debian)

sudo apt update
sudo apt install python3 python3-pip

2. Verifying pip

pip is Python’s package manager and is installed alongside Python. Check that it’s available:

pip --version
# or
pip3 --version

If pip isn’t found, try:

python -m pip --version

To upgrade pip to the latest version:

python -m pip install --upgrade pip

3. Installing VS Code

VS Code is the most popular editor for Python. It’s free and works on Windows, Mac, and Linux.

  1. Download from code.visualstudio.com
  2. Install it like any other application
  3. On first launch, pick a color theme (any one you like)

4. VS Code Extensions for Python

Open the Extensions panel with Ctrl+Shift+X (Mac: Cmd+Shift+X).

Must-Have

Python (by Microsoft)
- Syntax highlighting, autocompletion, and code execution
- Automatically suggested when you open a .py file
- Install this one first

Pylance (by Microsoft)
- Smart autocompletion and type checking
- Installed automatically alongside the Python extension

Python Indent
- Automatically inserts correct indentation after colons (if, def, for)
- Saves a lot of time while writing code

Python Docstring Generator
- Generates a docstring stub when you type """
- Useful for documenting functions

Error Lens
- Shows errors and warnings inline on the affected line, not just in the bottom panel
- Very handy — you see exactly what’s wrong at a glance


5. Configuring VS Code for Python

Selecting the Interpreter

VS Code needs to know which Python to use (especially important when using virtual environments):

  1. Open the Command Palette: Ctrl+Shift+P (Mac: Cmd+Shift+P)
  2. Type Python: Select Interpreter
  3. Choose the desired interpreter from the list

After selecting, the Python version will appear in the status bar at the bottom of the screen.

Auto Save

Enable auto save: File → Auto Save. Files will be saved on every change — you won’t lose your code.

Open Folders, Not Files

Always open your project folder, not individual files:

# In the terminal, from your project directory:
code .

Or use File → Open Folder. This way VS Code sees the full project structure.


6. The Integrated Terminal

VS Code has a built-in terminal — open it with Ctrl+` (backtick, the key below Esc).

The terminal opens automatically in the project folder. It’s convenient: you run code and see your files in the same window.


7. Useful Keyboard Shortcuts

Action Windows/Linux Mac
Run Python file F5 F5
Open terminal Ctrl+` Ctrl+`
Command Palette Ctrl+Shift+P Cmd+Shift+P
Search in project Ctrl+Shift+F Cmd+Shift+F
Format code Shift+Alt+F Shift+Option+F
Rename symbol F2 F2

Quick Verification

After installation, open a terminal and run:

python --version    # Python 3.x.x
pip --version       # pip xx.x.x
code --version      # VS Code version

All three commands should respond without errors — your environment is ready.

Your reaction to the article

💬 Comments (0)

🔐 Sign in to leave a comment
🚪 Login
💭

No comments yet

Be the first to share your opinion about this article!

🔗 Similar

Similar articles

Continue learning with these materials

📝

The datetime Module: Working with Dates and Times

datetime is Python's standard module for working with dates and times. It's part of the...

📅 08.05.2026 👁️ 66
📝

.env Files and Environment Variables: Keeping Sec…

Imagine you wrote a program with an API key hardcoded in the source and pushed...

📅 08.05.2026 👁️ 74
📝

Python Virtual Environments: Why and How

When you start a second Python project and run pip install requests — that library...

📅 08.05.2026 👁️ 64

Did you like the article?

Subscribe to our updates and receive new articles first. Grow with PyLand!