Get Started with Python in VSCode on Debian and Ubuntu-based distributions

M-Zohaib Nasir
3 min readJan 28, 2022

“Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum from 1985 to 1990. Like Perl, Python source code is also available under the GNU General Public License (GPL). This tutorial gives enough understanding of Python programming language.” ~Tutorialspoint

Procedure:

  1. If you have not already done so, install VSCode.
  2. Next, install the Python extension for VS Code.
    - Launch VS Code Terminal (Ctrl+`), paste the following command and press enter and it will automatically do that.
ext install ms-python.python

OR you can,

  • Click on extension-tab.
  • Put python in the search box.
  • Click the Python extension to get detailed information on the right pane.
  • Finally, click the Install button to install the Python extension.
Procedure to install python extension

3. Install a Python interpreter:

Multiple methods are given below:

- From Official Source:

Once Visual Studio Code is up and running, the next thing that we would need to set up is a python interpreter. Let us first navigate to https://www.python.org/downloads/ and download Python. Open download directory. You’ll get “*.tar.xz” file. Open terminal (Ctrl + Alt + T) and type following commands.

tar xzf fileName.tar.gz # to extract
./configure
make
sudo make install

Or

- Using apt-package:

sudo apt update  #update packages list
sudo apt-get install python
#Done

Or

- Using Deadsnakes PPA:

By default, you can’t add PPAs to your system’s package lists. The “software-properties-common” package provides you an efficient way to manage and add PPAs to your system.

#To get above mentioned package
sudo apt-get install software-properties-common
#Adding the deadsnakes PPA to your system’s sources list:
sudo add-apt-repository ppa:deadsnakes/ppa
#Updating your system's package lists:
sudo apt-get update
#Download the latest version of Python from the added PPA:
sudo apt-get install python3

Since the Deadsnakes PPA has almost every version of Python in its database, you can install older versions of Python as well. Just replace the package name with the version of python you want to install on your computer.

sudo apt-get install python3.2 
sudo apt-get install python3.3
sudo apt-get install python3.8

4. Now, For confirmation, check version:

#to check version type:    python --version
#or
python3 --version
# syntax to compile newFile.py
python newFile.py
#or
python3 newFile.py

Now, you’re ready to develop the first program in Python. Enjoy!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

M-Zohaib Nasir
M-Zohaib Nasir

No responses yet

Write a response