Okay.
In this video, I will show you how we can install Python and how to make sure you have installed Python
successfully on your machine.
At the moment I'm on my Mac machine and I will go to terminal here.
If you don't have a terminal here, you can also search for a terminal and open that.
So.
My terminal is open and in order to check if the python is installed on my machine, I can do Python.
And you can see here Python 2.7 is installed on my machine and you can see that three greater than signs
here.
That means I can write actually a python commands here for now.
I will put exit here like that and I'm back in my terminal now.
But you can see Python 2.7 here.
If I go to official page of Python and I'm on the W-w-w Python.org.
You can see here if we go for a downloads, the newest version is 3.73 it that means that the python
version I have here installed that's an old version of Python and we can distinguish the two different
versions version two and version three.
In our tutorial we will be using the newest version, which is three, and we need to have at least
3.5.
If you don't have 3.5, you need to go to this website and you can install the latest version from from
their website and I will show you momentarily how to do that.
But I have to say the reason why I have a Python 2.7 here is because the Macintosh by default comes
with a Python two pre-installed.
I also have Python three installed, but to run the python three I need to do python three.
If I do python and put three at the event a variant you can see my version is python 3.6 at the moment.
So I have also python three.
So in that case I will come back here to normal command line.
I have two versions of Python.
If I run a command python, the default 12.7 will be used if I run command Python three, the python
3.6 will be used.
So if you are not sure what is installed on your machine, you can always try python or python three.
Also you can do something like which python and then it will tell you where your python is installed
and that's a path to installation of your python.
So if I do which python three you can see I have a different python for this one and for this one.
So if you'd like to locate where your python is installed, you can use command which and then python.
Okay.
So I have python installed on this machine.
So we do need to install it here.
But if you don't have your python on your machine, if you go to the downloads, this website will automatically
detect your operating system and it will give you installation here.
So I have a Python 373 available for me to install so I can just install this.
And then in the wizard I click next, next, next and everything is installed.
That's very easy to do on Linux and on Mac, but it's a little bit more complicated on the windows because
on windows we need to do some extra steps because we need to make sure that Python will be installed
to our path.
So let's switch to Windows and I will show you how to do it.
Okay.
So we are on Windows Machine here on the same website, python.org.
And whatever we go to the downloads here you can see the download for Windows is available straight
away, so we can click on this icon and it will download version 373 and I have it already downloaded
here, so I can click on this and install Before I will do that, I will also show you here if you would
like to pick a specific version for your operating system or this doesn't recognize your operating system,
you can pick your operating system from here.
So if you are on Windows, you can click here and you will see a much more releases so we can find a
correct version you would like to install and you can go for this one.
We have Python three seven here already downloaded.
So we just click on this and I will just recommend it to go for, for the downloads we have here and
the button here that's the recommended version.
So what we can do here is to install our python.
As you can see here, the python will be installed on the user's krystian, which is my username, my
user installed on this machine, Appdata local programs and so on.
So you can install this version or you can customize it.
But very important part of this will be to add Python 3.7 to the path.
That means 3.7 Python will be added to the path and we can use it in the terminal.
So we will do customize this and you can actually do some options, but I will leave it as it is now.
I will click next.
And here you can decide on the on the path I will go for path C Python three seven like it is here.
And you also have add Python to environmental variables.
If you have that checked, this installation will add it for you, but it will also show you in a second
how we can actually verify it and add it on ourself.
That's why I've done the this part much easier to for us to use.
Actually, I can copy that part here and I will install Python.
Okay, Python has been installed successfully, so we'll close this window and then we can check two
things for first, let's say check if that has been added to our virtual environments.
So I can come here and I can type environment and I can see here edit the system environment variables.
And clicking on environmental variables here.
We can actually check if the python has been installed.
So we have both here.
That's user variable for for the user.
I'm currently logging in windows and that system variables and in both we have path.
So let's check if we have that python here in the path and we can see here Python 3.7.
That's the path I set up earlier in the installation is here.
If you leave it as it as the default, it was that long path here.
If you don't have that path here and you need to add it manually, you can click new here.
And then as we copy that from the previous screen, you can paste it here.
We already have it here, so I don't need to do it.
I will cancel and you also might need to add it for the system variables.
That's that will be for all users in the machine.
But if you have it for your current user and you're using current user, you will be able to use it.
So we verify that Python three has been added to our environment by the installation wizard.
I can cancel here and I console cancel here.
So any any time you will need to do it manually, you can do it with virtual environment.
So let's come to the command prompt.
And that's the same as in it was in the terminal.
If I do Python.
You can see a 2.7 has been installed.
I can remove exit this and I can do Python three.
And this still might not work on this machine because we visual elements has been added to the pad.
But usually we need to reset our machine to have that in place so we might not be able to use the Python
three straightaway.
But I also find it a few issues.
Normally with Windows you don't have Python 2.7.
I had to have this installed for one of the project that couldn't use the Python three, but usually
you will have only one python which is the newest, a 3.7 and then you don't need to apply that Python
three at the very end.
Whatever you will put Python, you will have the python latest version installed and that's the normal
setup.
You will have it.
If you don't have it, you need to make sure you have it to add it to virtual environment and then reset
your machine and you will be able to use it.
So in the next video, I will show you how to install Django.