Past tasks
Discord

1Getting Started 1.3Setting Up

1.3.1Setting Up Python

Install Python, VS Code, and notebook support, then check that each part works.

Edit this page

What you need

You need three things: Python, VS Code, and the Python extension for VS Code. Python runs your code. VS Code is where you write it. The extension helps VS Code work with Python, but it does not install Python for you.

Follow these steps in order. If something is already installed and works, move to the next step.

1. Install Python

Open Real Python's installation guide. Start with the section that checks your Python version. If Python 3 is already installed, you can skip the installation instructions.

  • Windows: Read “Checking the Python Version on Windows,” then “Windows: How to Install Python From the Microsoft Store” if you need to install it.
  • macOS: Read “Checking the Python Version on macOS,” then “macOS: How to Install Python Using the Official Installer” if you need to install it.
  • Linux: Read “Linux: How to Check or Get Python.” If Python 3 is missing, use your distribution's package manager. The exact command depends on your distribution.

Open a terminal and check the result:

python --version

On macOS or Linux, use python3 --version if python does not show Python 3. You should see a version starting with Python 3.

2. Install VS Code

Open Get Started with Visual Studio Code. Go to “Install VS Code,” choose your operating system, and follow its steps. Then open VS Code.

3. Add Python support and run a file

In VS Code, open the Extensions view. Search for Python, choose the extension published by Microsoft, and install it. If you have not used extensions before, the “Install a VS Code extension” section of this short guide shows where the button is.

Now follow Getting Started with Python in VS Code. Read “Understand the Python setup,” then follow “Start VS Code in a workspace folder,” “Create a Python source code file,” and “Run Python code.” A workspace folder is just a folder for your files. When VS Code asks you to choose an interpreter, select the Python 3 installation you checked in step 1.

4. Set up notebooks in VS Code

A Jupyter notebook is a file where you run code in separate cells and see the output below each cell. In the Extensions view, install Jupyter by Microsoft. Then watch Microsoft's short Jupyter walkthrough from 00:00 to 04:59. It covers installation, choosing an environment, and running cells.

If you prefer written steps, use “Setting up your environment” and “Create or open a Jupyter Notebook” in the VS Code Jupyter guide. Create a .ipynb file, choose your Python environment as the kernel in the top-right, and run a cell. The kernel is the Python environment that runs the notebook's code. If VS Code asks to install a Jupyter package for that environment, follow the prompt.

Check that it works

Create a file named hello.py in VS Code and put this in it:

print("Hello, IOAI!")

Run the file. You should see Hello, IOAI! in the terminal. Then put the same line in a Jupyter code cell and run it. You should see the same output below the cell.

If the version command, the .py file, and the notebook cell all work, your setup is done. If VS Code cannot run the file or cell, check which Python interpreter or kernel it selected before reinstalling anything.

Install the IOAI practice libraries

The 2026 Technical Appendix lists the contest libraries and says its environment uses a pinned Python 3.13. For local practice, this guide currently recommends Python 3.12.10; that recommendation may change. Install the third-party libraries named in the appendix, plus librosa for audio work:

python -m pip install torch torchvision torchaudio transformers accelerate peft trl scikit-learn xgboost lightgbm catboost sentence-transformers datasets evaluate spacy nltk gensim fasttext numpy pandas scipy polars pyarrow h5py opencv-python Pillow scikit-image albumentations matplotlib seaborn plotly tqdm joblib tensorboard pytorch-lightning pydantic pyyaml librosa

If you used python3 --version earlier, use python3 -m pip instead. Libraries such as csv, json, os, and re are already part of Python, so you do not install them separately. Check the rules for the year you compete, since the available packages can change.

Resources

SourceTitleWhy read it
Real PythonHow to Install Python on Your SystemCheck, install, and verify Python on Windows, macOS, or Linux.
VS CodeGet Started with Visual Studio CodeUse the Install VS Code section for your operating system.
VS CodeGetting Started with Python in VS CodeSet up Python support and run your first .py file.
Microsoft LearnGetting Started with Jupyter Notebooks in VS CodeA short video covering notebook setup and running cells.
VS CodeJupyter Notebooks in VS CodeWritten steps for selecting an environment and running a notebook.
IOAI2026 Contest Rules and Technical AppendixThe 2026 contest's Python version and available library list.