In the dynamic world of programming, Python stands tall as a versatile and powerful language, desired by developers for its readability, simplicity, and an extensive ecosystem of libraries. In this comprehensive guide, we will walk you through the process of installing Python and setting up your development environment using Visual Studio Code.
If you’re visual learner , you can see the full tutorial video below:
Install Python
Here is the basic guide to download and install python in your computer.
Start Download
Installing the python in your computer takes the following steps as listed below:
- Go to the official site
To go to the official site to download python , click on the link Download Python
- Click on the Download button
If you want to download old version of python scroll down to get the older versions as shown below:
- Check your OS bit
Once you have clicked on the version you want to download, you’ll get to choose the file appropriate for your device . To check the operating system bit, press Win+R
. It’ll open a run dialog box on your screen. There you type dxdiag
, and you’ll get to see the version of your OS as below:
As you can see, here the OS is of 64 bit. So you need to select the right file for your OS, 64 bit in this case.
- Click on the appropriate file
Now, you need to click the appropriate file as per your OS version. The list of file is shown as given below:
Once it is downloaded you’ll get the small popup of the file downloaded.
Start Installation
Once the python file is downloaded , you need to install it. To install it follow the steps below:
- Click on the ‘open file’
- Click on ‘Install Now’
You can check the add python.exe to PATH to use this file from command line.
After you click on the ” install now” , it’ll start installing and once it is complete you’ll get the message as shown in the image below:
Now, you’re done with python installation.
Run the command line
After the installation is completed, you now need to check if it is accessible from command line. It is because if you want run Scripts mostly you’ll be doing it from command line.
To run the command line follow the steps below:
- Open up the command prompt
To open the command prompt , type CMD
in start menu. Command prompt will open up for you and check if the python is working or not.
Type python in command prompt and and if its working you’ll get the python version as shown in the image below:
- Run python code
Now that the python is accessible on the command prompt, lets try to run the code on prompt line as shown below:
print("hello world")
If you get output as hello world then its working as expected.
Install VS Code
First of all we’ll see the version and the system type of the windows or the operating system. To check that open the run dialog box typing win+R
. Then type msinfo32
to see the system information with windows version.
As we can see , the system is of 64 bit. So the 64 bit software will work. It may be 32 bit in some computer for that 32 bit software will work.
Download VS Code]
For the further downloading process follow the steps below:
- Go to the official site to download VS Code.
To download VS Code, go through the link Download VS Code.
- Click on the ‘user installer – x64’
Clicking on x64 of user installer should download vs code . If its downloading you’ll get to see the loading as shown in the image
You can click on the ‘direct download link’ if it is not downloading .
It’ll download a vs code and its time to install the downloaded file in your computer.
Install VS Code
Now that you have downloaded the file , you need to install it in your device . To install vs code follow the steps below:
- Click on the ‘open file’.
- Accept the license agreement
- Select destination location
You can change the destination or path where you want to install vs code in your computer.
- Select start menu folder
- Select Additional Task
You can check ‘Add to path ‘ to run the code in command prompt also check ‘create a desktop icon’ to have a icon on desktop.
- Click on ‘Install’
- Click on ‘finish’
Here, the installation of vs code is completed and you are ready to go with vs code.
Installing python Extension In VS Code
After installing vs code in your device , you now can install python extension in vs code. To install python extension follow the steps below:
- Click on the extension icon (or type
ctrl+shift+x
)
- Install extension
Now ,the python extension is installed. This is only the extension for python , you should install python file ,so you can create a python file and run a python code on VS Code .
After everything is done , we now check if the code is running properly or not in vs code. For that , create a python file and run the code.
print("Lets code in python")
Run the above code, if the output is there as “lets code in python” then its working properly.
Alright, its all done here. Hopefully you have enjoyed the tutorial .
You may also like: Send Email Using Python
Conclusion-Install and Run Python With Vs Code
In this blog post, we’ve installed Python file and VS Code . After installing both , we installed python extension in vs code and we run the code to check if it is working properly or not. That’s all we did in this tutorial blog , if you have any problem regarding this , let me know in the comment below.