VSCodium – Installation and Basic Configuration

VSCodium is a community project that provides an alternative to Microsoft’s popular Visual Studio Code (VSCode) source code editor. VSCode is an advanced code editor that offers many features such as syntax highlighting, code auto-completion, integration with a version control system, and much more. Its source code is open source, allowing it to be freely modified and shared.

However, official distributions of VSCode include closed components and telemetry functions that collect and send user data to Microsoft. VSCodium, on the other hand, is a free version of this editor that removes the aforementioned closed components and telemetry, guaranteeing users greater control over their data and compliance with the open source philosophy.

Installing VSCodium on Ubuntu LTS

I presented the process of installing VSCodium on Ubuntu LTS using a custom software repository, which is not available by default on Ubuntu, in the article “Preparing Python environment on Ubuntu LTS”.

A detailed step-by-step description of this process can be found in the chapter “IDE – Installing VSCodium on Ubuntu LTS”.

Installing VSCodium on macOS Ventura

In the article “Preparing Python environment on macOS Ventura” I presented the process of installing VSCodium on macOS Ventura using the Homebrew package manager. This article contains a detailed description of the Homebrew installation procedure and how to solve a problem that may occur when running VSCodium for the first time.

This information is described in the chapter “IDE – Installing VSCodium on macOS Ventura”.

Basic configuration of VSCodium

Extensions installation

The “Extensions” tab allows us to install extensions that allow us to customise the working environment and increase productivity and efficiency when programming.

VSCodium - Extensions - Extensions installation - IamZIBI.com

The “Extensions” tab can be accessed in a number of ways:

by clicking on the "Extensions" icon on the left-hand side of the panel, which looks like four squares
or via the menu View > Extensions
or on Linux press Ctrl+Shift+X
or on macOS press Shift+Command+X

Then, in the field “Search Extensions in Marketplace”, we enter:

Python

We choose an official Microsoft extension called “Python” (from ms-python). Once the extension is installed, VSCodium will have Python support, including syntax, IntelliSense, linting, debugging, etc.

Configuration of virtual environment (venv)

The virtual environment (venv) allows us to isolate dependencies and packages for each Python project. This allows us to avoid conflicts between different versions of packages, keep our installed packages in order, and easily move our project to another computer. Virtual environments also allow us to test different versions of packages on a single system without worrying about affecting the whole system.

To configure the virtual environment (venv) in VSCodium, proceed as follows:

Open our project folder

Select menu File > Open Folder
or on Linux press Ctrl+O
or on macOS press Command+O

We select the folder containing our project or we can create a new one and select it. In my case it will be the folder created in the previous post called “LearnPython”.

Activate terminal

Select menu Terminal > New Terminal
or on Linux press Ctrl+Shift+`
or on macOS press Ctrl+`

A terminal will open in the location of our folder. We can now activate the virtual environment we created earlier by typing the following command:

source my_venv/bin/activate

Where my_venv is the name of our virtual environment.

We can also create a new virtual environment:

python3 -m venv my_venv2

and then activate it:

source my_venv2/bin/activate

If required, we can now install additional Python modules in the selected virtual environment.

Type the command in the terminal:

pip install module_name

Open the interpreter selection window

Select menu View > Command Palette...
or on Linux press Ctrl+Shift+P
or on macOS press Shift+Command+P 

and select “Python: Select Interpreter”.

In the “Select Interpreter” window that opens

We select the Python interpreter installed in our activated virtual environment (venv).

The virtual environment (venv) is configured and ready to use in VSCodium.

Configuration of virtual environment (venv) using the “Python Environment Manager” extension

The “Python Environment Manager” extension allows us to manage all the Python environments available in our working directory from one place with a single click. This makes management much easier when we are dealing with multiple virtual environments.

To configure a virtual environment (venv) in VSCodium using the Python Environment Manager extension, proceed as follows:

Open our project folder

Select menu File > Open Folder
or on Linux press Ctrl+O
or on macOS press Command+O

We select the folder containing our project or we can create a new one and select it. In my case it will be the folder created in the previous post called “LearnPython”.

Installing the “Python Environment Manager” extension

Go to the “Extensions” tab by clicking on the “Extensions” icon, which looks like four squares, on the left-hand side of the screen.

or via the menu View > Extensions
or on Linux press Ctrl+Shift+X
or on macOS press Shift+Command+X

The next step is to install the “Python Environment Manager” extension. Once installed, the “Python Environment Manager” extension icon will appear in the left-hand pane.

VSCodium - Extensions - "Python Environment Manager" extension - IamZIBI.com

Configuration of the “Python Environment Manager” extension

Open the “Python Environment Manager” tab by clicking on the new icon on the left-hand side. The first step is to update the window with the list of available Python environments. To do this, click on the “Refresh Environments” button in the top right-hand corner of the extension window. We will then see two lists, “Global” and “Venv”, of the Python environments available in our working directory. The “Global” list contains all available global Python interpreters. The “Venv” list contains our virtual Python environments.

Now, instead of using a terminal, we can simply select a Python environment from the list and then, by clicking on the appropriate icon, activate, add or remove virtual environments from our directory.

This way we have VSCodium set up to a basic degree and ready to learn Python.

Zbigniew Marcinkowski - IamZIBI.com

Zbigniew Marcinkowski

My name is Zbigniew, but you can call me ZiBi. I have been fascinated by technology since my childhood. At that time I tended to break things rather than fix them. Everything changed when I got my first computer. I found my passion, which has stayed with me through good times and bad. You can read more about this on the "About me" page.

Leave a Comment