Skip to content

Setting Up Python in VS Code

Once VS Code is installed, the next step is setting up Python — the core language used for simulations, automation, and scientific computing at Avkalan Labs. VS Code provides excellent Python support through extensions and built-in integrations for environments, Jupyter notebooks, and debugging.

Let’s go through the setup process step-by-step.

Install the Python Extension

First, install the official Python extension by Microsoft.

  1. Open VS Code.
  2. Click on the Extensions icon (📦) on the left sidebar.
  3. Search for “Python” by Microsoft (ms-python.python).
  4. Click Install.

This extension adds everything you need — syntax highlighting, linting, debugging, and notebook support.

alt text

Verify Python Installation

Before linking Python with VS Code, make sure it’s installed on your system. Open your terminal and run:

bash
python3 --version

or (on some Windows systems):

bash
python --version

If you see a version number like Python 3.10.12, you’re good to go.

Python version check

If Python is not installed, download and install it from the official site: 👉 https://www.python.org/downloads

During installation (on Windows), make sure to check the box: “Add Python to PATH”

Note:
If you encounter errors while running the above commands, ensure Python is installed on your system.

Selecting the Python Interpreter

Once Python is installed, VS Code needs to know which environment or interpreter to use.

To select it:

  1. Open the Command Palette (Ctrl + Shift + P or Cmd + Shift + P on Mac).
  2. Type and select “Python: Select Interpreter”.
  3. Choose the interpreter you want (for example, Python 3.10.12 (WSL) or a virtual environment).

You’ll see the active interpreter displayed in the bottom-right corner of VS Code’s status bar.

Python interpreter selection

Tip: If you’re using Docker or WSL, VS Code can automatically detect the Python interpreter inside those environments too.

Running a Python Script

Let’s test the setup with a simple script. Create a file called test.py and add:

python
print("Python setup successful in VS Code!")

Save the file, then run it in one of the following ways:

  • Option 1: Right-click in the editor → Run Python File in Terminal
  • Option 2: Press Ctrl + F5 (or Fn + F5 on Mac)
  • Option 3: Open the terminal and type:
bash
python test.py

You should see the output:

Python setup successful in VS Code!

alt text

Setting Up Jupyter Support (Optional)

If you’ll be working with simulation notebooks, install the Jupyter extension:

  1. Open the Extensions view.
  2. Search for “Jupyter” (ms-toolsai.jupyter).
  3. Click Install.

Once installed, you can open .ipynb files directly inside VS Code — just like in a Jupyter Notebook environment.

Summary

You’ve now:

  • Installed the Python extension in VS Code
  • Verified your Python installation
  • Selected the correct interpreter
  • Run your first Python script successfully
  • (Optionally) Added notebook and auto-formatting support

Your VS Code is now ready for Python-based simulation and scientific computing.