Hey everybody. What’s up? How’s it going?
Today we’re going to be doing a basic tutorial for installing Python on your computer, and specifically, I’m going to show you guys how to install Python with Visual Studio Code.
You can see here we have it opened up here on our computer , and I’m going to show you guys how you can actually install Python in and integrate it into Visual Studio Code, and create a terminal where you can actually run your Python code, all directly inside without making it too complicated.
So the first thing we have to do is actually install Python on our computer.
We can do that by going to the Python website.
What you want to do is go to downloads, and I’m going to download for Windows. They have the different options you have Mac or whatever operating system you are currently using. I’m just going to hit download for Windows.
You’ll see here that my download will appear at the bottom of the screen. We’ll just wait for that to finish off really quickly. And then we’ll double click this.
By the way, if you do install Python, and you miss the next step I’m going to give you, just uninstall it and do the same thing like I did.
The main thing you want to do is you want to make sure we have this Python 3.72 Path box checked.
This is the important thing, Check this box.
If you installed Python, and you didn’t check this box, just uninstall it, then reinstall it, and make sure this box is checked because this is what’s going to add the path to Python in Visual Studio Code and whatnot so that Visual Studio can actually access Python.
It takes a couple minutes to install, so be patient.
Then after Python is done installing, we’re going to have to actually go into Visual Studio, and actually install a few extensions.
It’s pretty simple, nothing too complicated.
Open Visual Studio Code and I’m going to go to extensions, right at the bottom. And the first one you want is Python. In the search box, type in Python. You’ll see this one right here at the very top pops up.
Make sure you install this extension to Visual Studio Code. It’ll be an install button, just click that, and then make sure you have it enabled.
You can see it’s currently enabled right now because it says disabled, but it’s actually enabled. Make sure you have that enabled.
The other one you want is Code Runner.
Let’s go back here and type in Code Runner into search, and what this does is it creates a terminal that we can actually run our Python in directly inside of Visual Studio Code, kind of like an IDE.
So it’s pretty cool. Make sure you install and enable it!
What we can do now is test our installation and we can do that by going to file, and making a new file.
I’m going to save the file as a Python script, just so our computer knows we are using Python.
So now we can see it’s turned into this little Python icon because Visual Studio Code has now recognized this as a Python file.
And I’m going to go ahead and just type in a simple print command.
Let’s save our document and see if it works!
What you want to do now is hit F1. And you can see the Code Runner now has these list of commands here, and we can hit run code.
What this will do is it creates a terminal at the bottom. The output will show us what happens with our Python code. We can see here at the bottom Python’s installed. So we can see that our code is actually running 100% correctly.
If you get an error code or something like that, it’s probably like I said because you installed Python the wrong way. Or you don’t have Code Runner and Python enabled in Visual Studio Code. So make sure you do that correctly. If you got to re-watch tutorial, go through that especially the video version!
And if all else fails and you can’t get Python to work, you can always go online and get a Python compiler online and use that!
I hope you enjoyed this guide and let me know what you think!