WEBVTT

00:03.240 --> 00:03.780
Okay.

00:03.780 --> 00:11.040
In this video, I will show you how we can install Python and how to make sure you have installed Python

00:11.040 --> 00:12.840
successfully on your machine.

00:13.080 --> 00:17.910
At the moment I'm on my Mac machine and I will go to terminal here.

00:17.940 --> 00:23.430
If you don't have a terminal here, you can also search for a terminal and open that.

00:23.430 --> 00:24.120
So.

00:25.370 --> 00:33.410
My terminal is open and in order to check if the python is installed on my machine, I can do Python.

00:34.520 --> 00:42.440
And you can see here Python 2.7 is installed on my machine and you can see that three greater than signs

00:42.440 --> 00:42.710
here.

00:42.710 --> 00:46.430
That means I can write actually a python commands here for now.

00:46.430 --> 00:52.040
I will put exit here like that and I'm back in my terminal now.

00:52.040 --> 00:55.790
But you can see Python 2.7 here.

00:56.000 --> 01:02.630
If I go to official page of Python and I'm on the W-w-w Python.org.

01:02.960 --> 01:12.980
You can see here if we go for a downloads, the newest version is 3.73 it that means that the python

01:12.980 --> 01:18.530
version I have here installed that's an old version of Python and we can distinguish the two different

01:18.530 --> 01:21.200
versions version two and version three.

01:21.230 --> 01:27.480
In our tutorial we will be using the newest version, which is three, and we need to have at least

01:27.480 --> 01:28.770
3.5.

01:28.800 --> 01:36.450
If you don't have 3.5, you need to go to this website and you can install the latest version from from

01:36.450 --> 01:40.590
their website and I will show you momentarily how to do that.

01:40.590 --> 01:50.010
But I have to say the reason why I have a Python 2.7 here is because the Macintosh by default comes

01:50.010 --> 01:52.380
with a Python two pre-installed.

01:52.710 --> 01:58.710
I also have Python three installed, but to run the python three I need to do python three.

01:58.740 --> 02:06.870
If I do python and put three at the event a variant you can see my version is python 3.6 at the moment.

02:06.870 --> 02:09.510
So I have also python three.

02:09.750 --> 02:14.370
So in that case I will come back here to normal command line.

02:14.460 --> 02:16.620
I have two versions of Python.

02:16.620 --> 02:24.780
If I run a command python, the default 12.7 will be used if I run command Python three, the python

02:24.780 --> 02:26.730
3.6 will be used.

02:27.120 --> 02:33.600
So if you are not sure what is installed on your machine, you can always try python or python three.

02:33.630 --> 02:43.110
Also you can do something like which python and then it will tell you where your python is installed

02:43.110 --> 02:45.720
and that's a path to installation of your python.

02:45.720 --> 02:54.210
So if I do which python three you can see I have a different python for this one and for this one.

02:54.210 --> 03:00.540
So if you'd like to locate where your python is installed, you can use command which and then python.

03:00.810 --> 03:01.170
Okay.

03:01.170 --> 03:03.810
So I have python installed on this machine.

03:03.810 --> 03:05.610
So we do need to install it here.

03:05.610 --> 03:13.230
But if you don't have your python on your machine, if you go to the downloads, this website will automatically

03:13.230 --> 03:17.670
detect your operating system and it will give you installation here.

03:17.670 --> 03:24.090
So I have a Python 373 available for me to install so I can just install this.

03:24.120 --> 03:28.290
And then in the wizard I click next, next, next and everything is installed.

03:28.440 --> 03:36.270
That's very easy to do on Linux and on Mac, but it's a little bit more complicated on the windows because

03:36.270 --> 03:42.720
on windows we need to do some extra steps because we need to make sure that Python will be installed

03:42.720 --> 03:43.500
to our path.

03:43.530 --> 03:46.260
So let's switch to Windows and I will show you how to do it.

03:48.070 --> 03:48.550
Okay.

03:48.550 --> 03:53.260
So we are on Windows Machine here on the same website, python.org.

03:53.260 --> 03:58.660
And whatever we go to the downloads here you can see the download for Windows is available straight

03:58.660 --> 04:05.890
away, so we can click on this icon and it will download version 373 and I have it already downloaded

04:05.890 --> 04:12.610
here, so I can click on this and install Before I will do that, I will also show you here if you would

04:12.610 --> 04:19.630
like to pick a specific version for your operating system or this doesn't recognize your operating system,

04:19.630 --> 04:22.300
you can pick your operating system from here.

04:22.300 --> 04:29.680
So if you are on Windows, you can click here and you will see a much more releases so we can find a

04:29.680 --> 04:34.660
correct version you would like to install and you can go for this one.

04:34.660 --> 04:38.200
We have Python three seven here already downloaded.

04:38.200 --> 04:45.880
So we just click on this and I will just recommend it to go for, for the downloads we have here and

04:45.880 --> 04:48.680
the button here that's the recommended version.

04:49.370 --> 04:55.370
So what we can do here is to install our python.

04:55.370 --> 05:02.120
As you can see here, the python will be installed on the user's krystian, which is my username, my

05:02.120 --> 05:05.960
user installed on this machine, Appdata local programs and so on.

05:05.960 --> 05:08.990
So you can install this version or you can customize it.

05:08.990 --> 05:15.290
But very important part of this will be to add Python 3.7 to the path.

05:15.320 --> 05:21.830
That means 3.7 Python will be added to the path and we can use it in the terminal.

05:21.830 --> 05:30.290
So we will do customize this and you can actually do some options, but I will leave it as it is now.

05:30.440 --> 05:31.730
I will click next.

05:33.310 --> 05:44.560
And here you can decide on the on the path I will go for path C Python three seven like it is here.

05:46.520 --> 05:49.960
And you also have add Python to environmental variables.

05:49.970 --> 05:55.700
If you have that checked, this installation will add it for you, but it will also show you in a second

05:55.700 --> 05:58.440
how we can actually verify it and add it on ourself.

05:58.460 --> 06:03.290
That's why I've done the this part much easier to for us to use.

06:04.040 --> 06:09.380
Actually, I can copy that part here and I will install Python.

06:10.730 --> 06:16.610
Okay, Python has been installed successfully, so we'll close this window and then we can check two

06:16.610 --> 06:22.400
things for first, let's say check if that has been added to our virtual environments.

06:22.400 --> 06:31.040
So I can come here and I can type environment and I can see here edit the system environment variables.

06:32.590 --> 06:35.260
And clicking on environmental variables here.

06:35.260 --> 06:38.320
We can actually check if the python has been installed.

06:38.320 --> 06:39.760
So we have both here.

06:39.760 --> 06:42.250
That's user variable for for the user.

06:42.250 --> 06:47.410
I'm currently logging in windows and that system variables and in both we have path.

06:47.440 --> 06:55.330
So let's check if we have that python here in the path and we can see here Python 3.7.

06:55.330 --> 06:59.770
That's the path I set up earlier in the installation is here.

06:59.770 --> 07:03.580
If you leave it as it as the default, it was that long path here.

07:03.580 --> 07:08.860
If you don't have that path here and you need to add it manually, you can click new here.

07:08.860 --> 07:14.080
And then as we copy that from the previous screen, you can paste it here.

07:14.080 --> 07:16.510
We already have it here, so I don't need to do it.

07:16.510 --> 07:22.150
I will cancel and you also might need to add it for the system variables.

07:22.150 --> 07:25.480
That's that will be for all users in the machine.

07:25.480 --> 07:30.460
But if you have it for your current user and you're using current user, you will be able to use it.

07:30.460 --> 07:37.340
So we verify that Python three has been added to our environment by the installation wizard.

07:37.370 --> 07:40.190
I can cancel here and I console cancel here.

07:40.190 --> 07:46.400
So any any time you will need to do it manually, you can do it with virtual environment.

07:46.400 --> 07:48.860
So let's come to the command prompt.

07:48.860 --> 07:52.100
And that's the same as in it was in the terminal.

07:52.100 --> 07:53.390
If I do Python.

07:55.220 --> 07:58.010
You can see a 2.7 has been installed.

07:58.010 --> 08:02.810
I can remove exit this and I can do Python three.

08:03.740 --> 08:11.630
And this still might not work on this machine because we visual elements has been added to the pad.

08:11.660 --> 08:19.760
But usually we need to reset our machine to have that in place so we might not be able to use the Python

08:19.760 --> 08:20.990
three straightaway.

08:21.500 --> 08:24.110
But I also find it a few issues.

08:24.110 --> 08:27.950
Normally with Windows you don't have Python 2.7.

08:27.950 --> 08:34.190
I had to have this installed for one of the project that couldn't use the Python three, but usually

08:34.190 --> 08:42.140
you will have only one python which is the newest, a 3.7 and then you don't need to apply that Python

08:42.140 --> 08:43.820
three at the very end.

08:43.850 --> 08:52.580
Whatever you will put Python, you will have the python latest version installed and that's the normal

08:52.580 --> 08:52.970
setup.

08:52.970 --> 08:53.810
You will have it.

08:53.840 --> 08:59.570
If you don't have it, you need to make sure you have it to add it to virtual environment and then reset

08:59.570 --> 09:02.720
your machine and you will be able to use it.

09:04.200 --> 09:08.610
So in the next video, I will show you how to install Django.
