1
00:00:00,000 --> 00:00:01,000
Hello guys.

2
00:00:01,000 --> 00:00:02,000
So welcome to the Python series.

3
00:00:02,000 --> 00:00:08,000
Uh, now we are going to start our first session with respect to Python.

4
00:00:08,000 --> 00:00:13,000
Now, what we are going to do in this video is that, uh, uh, and the entire code that I'm actually

5
00:00:13,000 --> 00:00:17,000
going to specifically write, I'm going to use the VS code ID, uh, vs code ID.

6
00:00:17,000 --> 00:00:24,000
I find it really amazing because here you'll be able to execute your Jupyter notebook files, your.py

7
00:00:24,000 --> 00:00:24,000
files.

8
00:00:24,000 --> 00:00:28,000
Along with that, you'll also be able to create all the environments very much easily.

9
00:00:29,000 --> 00:00:32,000
Uh, so it is feasible that I specifically use VS code.

10
00:00:32,000 --> 00:00:37,000
Along with that, you have a lot of features like extensions, code assistance, and many more things.

11
00:00:38,000 --> 00:00:43,000
So the first step, uh, as we have seen starting, you know, uh, what I'm actually going to do is

12
00:00:43,000 --> 00:00:50,000
that over here, we are going to create our new environment, as I said, um, in this Python series,

13
00:00:50,000 --> 00:00:56,000
I'm going to use the newest Python version that is Python 3.12, and I am going to teach in such a way

14
00:00:56,000 --> 00:01:03,000
that we all, we see all the new features that have actually come from 3.10 to 3.12.

15
00:01:03,000 --> 00:01:08,000
So all the new features that are specifically there, uh, we will be also discussing about them in

16
00:01:08,000 --> 00:01:09,000
this Python series.

17
00:01:09,000 --> 00:01:14,000
Uh, the first step, as you know, that, uh, I'm going to create an environment and again, why you

18
00:01:14,000 --> 00:01:19,000
specifically require an environment because, uh, an environment is, necessary whenever you start

19
00:01:19,000 --> 00:01:20,000
a new project.

20
00:01:20,000 --> 00:01:26,000
Because in our Python project or in our data science project, we make sure that we use multiple packages,

21
00:01:26,000 --> 00:01:27,000
multiple libraries and.

22
00:01:27,000 --> 00:01:27,000
All right.

23
00:01:27,000 --> 00:01:33,000
And uh, every couple of months this packages or this libraries have new features and most of them are

24
00:01:33,000 --> 00:01:34,000
open source packages or libraries.

25
00:01:34,000 --> 00:01:35,000
Right.

26
00:01:35,000 --> 00:01:39,000
So they definitely have a lot of features that gets included every couple of months.

27
00:01:39,000 --> 00:01:45,000
So it is always necessary that you always maintain, uh, or try to create your entire projects in a

28
00:01:45,000 --> 00:01:50,000
separate, uh, with a separate environment so that there should be not any conflict, as you probably

29
00:01:50,000 --> 00:01:55,000
go ahead, uh, whenever a new feature is probably coming up, you know, with respect to the packages,

30
00:01:55,000 --> 00:01:59,000
uh, you can actually create a new project and create a new environment out there.

31
00:01:59,000 --> 00:02:03,000
But here, uh, the first step, what I'm actually going to do is that let's go ahead and create our

32
00:02:03,000 --> 00:02:04,000
environment.

33
00:02:04,000 --> 00:02:07,000
And for this also I will be using conda command.

34
00:02:07,000 --> 00:02:10,000
So first of all I'll not go ahead and write in PowerShell.

35
00:02:10,000 --> 00:02:13,000
Instead I'll go and click on uh Command prompt.

36
00:02:13,000 --> 00:02:15,000
So quickly let's go ahead and write it down.

37
00:02:15,000 --> 00:02:21,000
So here I'm going to write conda create minus p v and v python uh double equal to.

38
00:02:21,000 --> 00:02:25,000
Let's say I want to go ahead with Python 3.12 okay.

39
00:02:25,000 --> 00:02:30,000
And uh understand one thing is that, uh, over here we are using this conda create command v, and

40
00:02:30,000 --> 00:02:34,000
v is specifically your environment name.

41
00:02:34,000 --> 00:02:37,000
And which Python version we are specifically using.

42
00:02:37,000 --> 00:02:38,000
It is 3.12.

43
00:02:38,000 --> 00:02:40,000
Again based on different different projects.

44
00:02:40,000 --> 00:02:43,000
It is not necessary that you always need to use 3.12.

45
00:02:43,000 --> 00:02:48,000
It depends on the kind of packages that are available, let's say open source packages.

46
00:02:48,000 --> 00:02:51,000
When we are creating deep learning projects or any machine learning projects as such.

47
00:02:51,000 --> 00:02:52,000
Right.

48
00:02:52,000 --> 00:02:56,000
So but here, uh, since we are learning this Python series completely from basics, I'm going to go

49
00:02:56,000 --> 00:02:58,000
ahead and use this environment.

50
00:02:58,000 --> 00:02:59,000
So once I probably click this.

51
00:02:59,000 --> 00:03:03,000
So here you'll be able to see the installation will start taking place.

52
00:03:03,000 --> 00:03:09,000
And when we are creating a virtual environment, some basic libraries or packages will be automatically

53
00:03:09,000 --> 00:03:10,000
downloaded by this conda command.

54
00:03:10,000 --> 00:03:17,000
So now here uh you can see over here what are the basic commands, uh, basic new packages that are

55
00:03:17,000 --> 00:03:18,000
basically getting installed.

56
00:03:18,000 --> 00:03:20,000
So here are all the packages.

57
00:03:20,000 --> 00:03:23,000
So I'm just going to go ahead and click on uh press Y.

58
00:03:23,000 --> 00:03:27,000
And once I probably do this all the installation of the libraries will happen.

59
00:03:27,000 --> 00:03:28,000
Right.

60
00:03:28,000 --> 00:03:30,000
So it is going to take some amount of time.

61
00:03:30,000 --> 00:03:32,000
Again it depends on your internet speed.

62
00:03:32,000 --> 00:03:34,000
But let me just go ahead and show you.

63
00:03:34,000 --> 00:03:37,000
So here you can see a V and V environment is basically created.

64
00:03:37,000 --> 00:03:40,000
And these are all the default packages that you will be able to find out.

65
00:03:40,000 --> 00:03:43,000
Inside this right there will be a DLL folder.

66
00:03:43,000 --> 00:03:45,000
There will be an include folder.

67
00:03:45,000 --> 00:03:45,000
Right.

68
00:03:45,000 --> 00:03:50,000
So, uh, what is the basic environment that is required for any Python project.

69
00:03:50,000 --> 00:03:54,000
So that will be covered up inside this particular folder.

70
00:03:54,000 --> 00:03:54,000
Okay.

71
00:03:54,000 --> 00:03:59,000
Now once you go ahead and click this uh now the next thing is that let's say um, you, you want to

72
00:03:59,000 --> 00:04:01,000
activate this environment, right?

73
00:04:01,000 --> 00:04:05,000
So in order to activate this environment I will go ahead and write conda activate.

74
00:04:05,000 --> 00:04:09,000
And we go ahead and use this v and v folder itself.

75
00:04:09,000 --> 00:04:11,000
Write the same v and v folder.

76
00:04:11,000 --> 00:04:13,000
And here we are just going to give the location of this write.

77
00:04:13,000 --> 00:04:19,000
So once we press this you'll be able to see that I have activated the V and V environment okay.

78
00:04:19,000 --> 00:04:27,000
And now you can probably run any kind of.py files directly from here by using Python specifically,

79
00:04:27,000 --> 00:04:31,000
let's say I probably go ahead and create my app.py.

80
00:04:31,000 --> 00:04:35,000
And let's say that I am just going to write over here print one plus one.

81
00:04:35,000 --> 00:04:36,000
Right.

82
00:04:36,000 --> 00:04:38,000
So this is the basic command.

83
00:04:38,000 --> 00:04:41,000
Uh, and I'm printing this particular numerical operation one plus one.

84
00:04:41,000 --> 00:04:47,000
Now if I really want to run this app dot pi, I have to make sure that I'm in the same folder location.

85
00:04:47,000 --> 00:04:49,000
I have activated my venv environment.

86
00:04:49,000 --> 00:04:53,000
And now within this particular environment, we will go ahead and just execute this file.

87
00:04:53,000 --> 00:04:57,000
In order to execute it, you just need to write Python app.py.

88
00:04:57,000 --> 00:05:01,000
So once you do this here, you'll be able to see that I'm able to get the response.

89
00:05:01,000 --> 00:05:01,000
Okay.

90
00:05:01,000 --> 00:05:07,000
Now uh, let me show you one more thing because see uh, as we go ahead with more lectures.

91
00:05:07,000 --> 00:05:07,000
Right.

92
00:05:07,000 --> 00:05:13,000
I'm actually going to create a folder, let's say this is first folder is Python basics okay.

93
00:05:13,000 --> 00:05:14,000
Python basics.

94
00:05:14,000 --> 00:05:20,000
So inside this folder itself I will go ahead and create my Jupyter notebook file or.py file.

95
00:05:20,000 --> 00:05:21,000
Anything that I require.

96
00:05:21,000 --> 00:05:24,000
Let's say I go ahead and create my Jupyter notebook file.

97
00:05:24,000 --> 00:05:28,000
By default, uh, let's say this is my test dot ipynb.

98
00:05:28,000 --> 00:05:28,000
Okay.

99
00:05:29,000 --> 00:05:34,000
Now this Jupyter notebook file, uh, will be the similar Jupyter notebook file that we actually use

100
00:05:34,000 --> 00:05:35,000
in, uh, Anaconda.

101
00:05:35,000 --> 00:05:36,000
Right.

102
00:05:36,000 --> 00:05:41,000
Uh, the Jupyter notebook, but in Python also, uh, sorry, in VS code, you will be able to see that.

103
00:05:41,000 --> 00:05:46,000
Yes, internally you will be able to execute this text, uh, this uh, Jupyter notebook file also.

104
00:05:46,000 --> 00:05:51,000
Now, initially, if I go ahead and uh, let's say over here, an option is probably coming up saying

105
00:05:51,000 --> 00:05:53,000
that, hey, detecting kernels.

106
00:05:53,000 --> 00:05:59,000
So if I want to say select the same environment right V and V I can go ahead and click on Detect kernels.

107
00:05:59,000 --> 00:06:03,000
So here you'll get an option of selecting the Python environment.

108
00:06:03,000 --> 00:06:05,000
Let's say this is the environment that I have created right.

109
00:06:05,000 --> 00:06:08,000
Uh v and v Python 3.12.0.

110
00:06:08,000 --> 00:06:13,000
And these are all the other environments that I have actually created in my, uh, local system.

111
00:06:13,000 --> 00:06:13,000
Right.

112
00:06:13,000 --> 00:06:16,000
So I'm just going to go ahead and select uh, 3.12.

113
00:06:16,000 --> 00:06:17,000
Oh okay.

114
00:06:17,000 --> 00:06:19,000
Now let's go ahead and execute any code.

115
00:06:19,000 --> 00:06:19,000
Right.

116
00:06:19,000 --> 00:06:25,000
So this is my code cell okay I can create any number of code cell that I really want right now.

117
00:06:25,000 --> 00:06:26,000
Code cell is nothing.

118
00:06:26,000 --> 00:06:30,000
But here I will be writing all my Python code in order to execute it.

119
00:06:30,000 --> 00:06:32,000
Along with that you also have something like markdown.

120
00:06:32,000 --> 00:06:36,000
So let's say that I, uh I have this markdown cell.

121
00:06:36,000 --> 00:06:40,000
I can basically write comments saying like this, like let's say Python example.

122
00:06:40,000 --> 00:06:46,000
And if I execute it, in order to execute this cell I have to press shift enter.

123
00:06:46,000 --> 00:06:47,000
Okay.

124
00:06:47,000 --> 00:06:50,000
So if I probably press shift enter automatically this will get executed.

125
00:06:50,000 --> 00:06:55,000
Now the the reason we have used some markdown because I needed to write some information over here.

126
00:06:55,000 --> 00:06:56,000
So like title and all.

127
00:06:56,000 --> 00:06:57,000
So I'm writing it over here.

128
00:06:57,000 --> 00:06:58,000
Right.

129
00:06:58,000 --> 00:07:02,000
So if you press shift enter then automatically this cell will get executed.

130
00:07:02,000 --> 00:07:07,000
Uh, along with this you also have an option of run all you know, if you want to run all the cells

131
00:07:07,000 --> 00:07:12,000
over here, if you go ahead and, uh, see if you just go, go ahead and press right click, you'll

132
00:07:12,000 --> 00:07:14,000
be having so many different, different options.

133
00:07:14,000 --> 00:07:15,000
Okay.

134
00:07:15,000 --> 00:07:20,000
But we are just going to use shift run uh shift enter so that we'll be able to execute it okay.

135
00:07:20,000 --> 00:07:21,000
Now this is fine.

136
00:07:21,000 --> 00:07:24,000
Let's run our first code in Jupyter Notebook.

137
00:07:24,000 --> 00:07:25,000
So if I am going to write one plus one.

138
00:07:25,000 --> 00:07:29,000
So here you can see I'm getting an error running cell with v and v.

139
00:07:29,000 --> 00:07:34,000
Python 3.20120 requires the ipykernel package.

140
00:07:34,000 --> 00:07:37,000
Okay, so this is one of the requirement that we really need to do.

141
00:07:37,000 --> 00:07:40,000
Uh, we need to install Ipykernel.

142
00:07:40,000 --> 00:07:41,000
Okay.

143
00:07:41,000 --> 00:07:44,000
So here I'm what I'm going to write is that pip install.

144
00:07:44,000 --> 00:07:49,000
If I want to install any packages I have to just go ahead and write pip install Ipykernel.

145
00:07:49,000 --> 00:07:49,000
Okay.

146
00:07:49,000 --> 00:07:55,000
So once I probably do this you'll be able to see that if I press enter you'll be seeing that hey, my

147
00:07:55,000 --> 00:07:57,000
Ipykernel is basically getting installed now.

148
00:07:57,000 --> 00:07:59,000
What is this Ipykernel package?

149
00:07:59,000 --> 00:08:03,000
Ipykernel package is nothing, but it provides a kernel to this specific Jupyter notebook, which will

150
00:08:03,000 --> 00:08:07,000
be responsible in executing the Python code, right?

151
00:08:07,000 --> 00:08:10,000
It is pretty much necessary and compulsory in Anaconda.

152
00:08:10,000 --> 00:08:14,000
The default Jupyter notebook has Ipykernel already integrated to it.

153
00:08:14,000 --> 00:08:17,000
Okay, so this is the first thing that you really need to do.

154
00:08:17,000 --> 00:08:22,000
Whenever you want to run the Jupyter notebook, you just go ahead and right pip install Ipykernel.

155
00:08:22,000 --> 00:08:27,000
One more thing that you can actually do is that here what I will do, I will go ahead and create one

156
00:08:27,000 --> 00:08:32,000
requirement dot txt because this requirement dot txt you know later on whatever packages I want.

157
00:08:32,000 --> 00:08:35,000
Let's say the first package I want is Ipykernel.

158
00:08:35,000 --> 00:08:40,000
I'll keep a note of this over here and any number of packages I will be requiring, let's say in the

159
00:08:40,000 --> 00:08:44,000
future classes you'll be seeing pandas, numpy, different different packages.

160
00:08:44,000 --> 00:08:46,000
So we will try to install it from here itself.

161
00:08:46,000 --> 00:08:50,000
We'll write over here and we'll run this requirement dot txt which will be responsible in installing

162
00:08:50,000 --> 00:08:51,000
all the packages.

163
00:08:51,000 --> 00:08:55,000
Now you can see that uh, the Ipykernel has got successfully executed.

164
00:08:55,000 --> 00:08:57,000
Now let me just go ahead and run this same code.

165
00:08:57,000 --> 00:09:00,000
So here you'll be able to see if I run the same code.

166
00:09:00,000 --> 00:09:01,000
Now it is just going to execute.

167
00:09:01,000 --> 00:09:03,000
It is saying that connecting to Colonel.

168
00:09:03,000 --> 00:09:05,000
And here I am having my output.

169
00:09:05,000 --> 00:09:06,000
Right.

170
00:09:06,000 --> 00:09:09,000
So now I can probably go ahead and write any type of code that I want.

171
00:09:09,000 --> 00:09:10,000
Let's say I want to go ahead and write.

172
00:09:10,000 --> 00:09:11,000
Print.

173
00:09:11,000 --> 00:09:14,000
Hello hello world.

174
00:09:14,000 --> 00:09:14,000
Okay.

175
00:09:14,000 --> 00:09:15,000
Something like this.

176
00:09:15,000 --> 00:09:19,000
So here we'll be able to see that it is executing right for.py file.

177
00:09:19,000 --> 00:09:25,000
I don't want any type of colonel because in the terminal in the terminal automatically that particular

178
00:09:25,000 --> 00:09:28,000
terminal uh, has this environment set up.

179
00:09:28,000 --> 00:09:28,000
Right.

180
00:09:28,000 --> 00:09:33,000
So in order to execute it I have to go ahead and write Python app dot p y, right.

181
00:09:33,000 --> 00:09:34,000
Or whatever is the file name.

182
00:09:34,000 --> 00:09:40,000
In this case, if I want to execute any cell, I have to just press that particular cell and press shift

183
00:09:40,000 --> 00:09:41,000
enter.

184
00:09:41,000 --> 00:09:41,000
Okay.

185
00:09:42,000 --> 00:09:46,000
So in this video we have discussed about how you can go ahead and create your environment.

186
00:09:46,000 --> 00:09:51,000
because going forward, any session that is probably going to come up in this course, I'm going to

187
00:09:51,000 --> 00:09:54,000
probably create a folder wise like this.

188
00:09:54,000 --> 00:09:59,000
For first class, I will probably create Python basics, create my Jupyter notebook file or.py file,

189
00:09:59,000 --> 00:10:03,000
execute all the code in front of you, write all the code in front of you and continue right.

190
00:10:03,000 --> 00:10:08,000
So for right now, I will just go ahead and delete this folder because I don't require it.

191
00:10:08,000 --> 00:10:11,000
Because at the end of the day, I will do one thing.

192
00:10:11,000 --> 00:10:12,000
Okay, just a second.

193
00:10:12,000 --> 00:10:13,000
I will just close this, okay?

194
00:10:14,000 --> 00:10:14,000
Yeah.

195
00:10:14,000 --> 00:10:19,000
Now let me just go ahead and delete it, because in the next session I will go ahead and create everything

196
00:10:19,000 --> 00:10:24,000
from scratch requirement dot txt I will keep it so that I keep on updating my packages.

197
00:10:24,000 --> 00:10:27,000
So yes, this was it for my side.

198
00:10:27,000 --> 00:10:29,000
I hope you like this video.

199
00:10:29,000 --> 00:10:33,000
And in the next video we will start our Python basics.

200
00:10:33,000 --> 00:10:34,000
So yes, this was it.

201
00:10:34,000 --> 00:10:35,000
Thank you.

202
00:10:35,000 --> 00:10:35,000
Take care.

203
00:10:35,000 --> 00:10:36,000
Bye bye.

