How to Install and Configure Python and VSCode

Programming Languages

Hello everyone,

Python is one of the most used programming languages nowadays. It can be used to create many different types of applications, like websites, desktop application, artificial intelligence, games and even mobile development.

Here at Neps, we have a course that will teach you all the basics about this programming language, it is called Python Bootcamp. One of the first classes will teach you how to install and configure Python and Visual Studio Code (VSCode) on a Windows machine, so you can start your journey to become a Python programmer.

Installing the development environment is usually the hardest and most tedious task when learning a new programming technology. Let’s get it done quickly so we can start developing our applications in Python 😄

Let’s get started! The first step is installing Python 3 in our system. To do that, go to the Python website, you will find some versions available, it is recommended that you download the latest version.

Figure 1

Just double-click the downloaded file to start the installation. We recommend installing it with the default options. However, if you decide to customize the installation, make sure that you are installing pip, since it will allow us to easily install Python packages. Also, make sure to mark Add Python to PATH.

Figure 2

Additionally, agree to disable the path length limit to avoid problems in the future.

Figure 3

The next step is to install the Visual Studio Code (VSCode). It is a cross-platform Integrated Development Environment (IDE) created by Microsoft; it allows you to code in many different languages including ** Python**, Javascript, C, C++, Java and Ruby. It is a code editor with built-in support for multiple languages, automatic indentation, syntax highlighting, debugger, git (version control), refactoring features and much more. It also has an extension model with a rich ecosystem that allows you to install multiple plugins. We plan to write about the other VSCode features in the future, so stay tuned 😃.

To install VSCode, go to the website and download the appropriated version based on your operating system.

Figure 4

Just double-click the downloaded file and install it in your desired folder.

It is recommended that you mark both “Open with Code” options since it allows you to open VSCode directly in the folder that you are working in.

Figure 5

Now you can launch the VSCode. It should look like the image below.

Figure 6

To create our first Python program hit CTRL + N to create a new file and save it using CTRL + S. Save the file using the “.py” extension (we are naming our file “test.py”) and VSCode will activate the Python extension for your file.

Now we can write our first Python program. Write the following source code:

print("Hello Neps Academy!")

To execute the file, open a new terminal (command line) and navigate to the folder where you salved the file (using the cd command followed by the path):

Figure 7

cd "C:\Users\WDAGUtilityAccount\Downloads"

Now you can execute your file using:

python test.py

Figure 8

Adding the Python Extension

Installing the Python extension will add even more functionalities when working with Python in VSCode. Go to the sidebar and click in Extensions, then search for “Python”, click in Install.

Figure 9

Now you can easily change your Python interpreter on the bottom (Figure 10) and run your code by just clicking on the run button on top (Figure 11).

Figure 10

Figure 11

Tips

  1. You can open the VSCode in a specific folder using the Open in Code command. Just right click on the folder (be careful to not click in a file, see the image) that you are working on and choose to open on VSCode.

Figure 12

  1. VSCode is super customizable. So you probably should spend some time making your VSCode exactly the way that you like. You can start going to Preferences -> Settings.

Figure 13

  1. While VSCode is our favourite, there are many IDEs for Python development; another solid option is PyCharm created by JetBrains.

That is it! You just installed and configured your Python IDE; now you are ready to start coding in Python!

I hope you enjoyed this guide. If you really want to get into programming, you should consider taking a look at our courses, especially our Python Bootcamp course. For more content about programming and to learn more about new tools and libraries stay tuned to our Blog, we will be posting more content soon!

Have a fantastic day!