Full transcript
Introduction
0:00hello all my name is krishnaik and
0:02welcome to my YouTube channel so guys we
0:05are about to start the end-to-end
0:07machine learning implementation web
0:08deployment
0:10and again the main aim of this specific
0:12series is to develop end-to-end projects
0:16and the things that we are going to
0:17learn the similar things are basically
0:19applied in the industry when we are
0:21solving any kind of projects
0:24uh we are going to basically discuss in
0:26the series about each and every modules
0:28what all things we can basically do on
0:31top of it and how we can easily crack
0:34any data science interviews this
0:36end-to-end project implementation will
0:38be a game changer for cracking data
0:41science interviews why because all the
0:43students who have till now cracked or
0:45any professionals who have cracked data
0:47science interviews they have really
0:49explained the projects very well okay so
0:52from your side only one thing is
0:55basically required that is dedication
0:57if you are able to dedicate properly if
1:00you are able to see if you are able to
1:01understand if you are able to practice
1:03right how the project implementation is
1:06done
1:07and then you can probably apply in
1:09different different projects like in
1:10deep learning and all all these
1:12techniques will be same we'll try to
1:14create a generic project structure we'll
1:16try to use metallurgies tools techniques
1:19in such a way that you will be able to
1:21apply in any kind of projects going
1:24forward
1:25so uh please make sure that you support
1:27the series share with many of your
1:30friends right whoever required this kind
1:33of help because I think this is probably
1:35for the first time uh I'm going to do
1:38something like this where I'm going to
1:40provide so much of effort in developing
1:42this specific projects and if you don't
1:45share it trust me this will get lost
1:48somewhere right so people will actually
1:50lose that specific benefit that is
1:52required from out of it right so please
1:54make sure that you share this video with
1:56everyone
1:57now what all things we are going to do
2:00uh what all things we are planning to do
2:02everything we will be discussing how I'm
2:04going to divide this particular parts of
2:06all this particular series that also I
2:08will be discussing so let me go ahead
2:10and let me share my screen so uh
2:13and all the line by line code I will be
2:15writing it in front of you will be
2:17implementing in such a way that
2:19parallelly will try to implement I will
2:21be committing the code and then based on
2:23that uh we will go ahead with it okay
2:25so let's go ahead and let's try to do
2:28this okay now I will just open this one
2:32so obviously I've spoken about the
2:34agenda so agenda of today's video
Agenda
2:37is that whenever you are doing any kind
2:40of machine learning or deep learning
2:42project the first and the most important
2:44thing is that it's all about your
2:46repository right where you're committing
2:48the code because you specifically work
2:51in a team right team of people
2:53now when you are working with the team
2:55of people definitely you will be seeing
2:58that there are many people who will be
2:59collaborating right at the same time
3:02they'll be committing the code they will
3:04be merging the code they will be
3:05developing new models so the first thing
3:08is that what we are going to do is that
3:10we are going to basically set up the
3:12GitHub right and this GitHub will be our
3:16repository right for committing our code
3:19and probably if you're working in team
3:21you can also work in team so that your
3:24development will be in sync whenever you
3:26are probably developing it right the
3:29entire application in short so setting
3:31up the GitHub will be the first one then
3:34uh in this GitHub what are the best
3:37things that we will be applying like
3:39let's say in the first case I want to go
3:41ahead and probably set up a new
3:44environment right
3:46so GitHub
3:48and to this is today's agenda what I'm
3:50going to basically say new environment
3:52right how do we create a new environment
3:54what all things you have to make sure
3:56that uh while working with a new
3:58environment there are some things that
3:59we really need to make sure that that
4:01thing is in place before implementing
4:03the project it will always a good
4:05practices then uh we will try to decide
4:08a mini project structure mini project
4:11structure
4:13mini project structure
4:16anyhow I'm actually developing the
4:18entire project right we'll be discussing
4:20also about setup right setup.py now what
4:24is the importance of setup.py we'll try
4:26to understand after creating the new
4:27environment and finally how probably I
4:30can also build a package using setup.wi
4:33we'll also discuss about
4:35requirements.txt so uh
4:38again there is a relationship between
4:40requirements.txt 10 setup.py also we'll
4:42discuss about that we'll create a new
4:44environment and we'll do this we'll do
4:46all these tasks today
4:47and in the next video what we are
4:49basically going to do is that we are
4:51going to go with the next step wherein
4:54we will be implementing logging
4:55exception
4:56exception handling and then we will try
4:59to decide a formal project structure how
5:01do we decide a problem uh project
5:03structure that also I'll be talking
5:04about what are the best practices that
5:06we specifically follow
5:08now uh let's go with the first one that
5:10is set up the GitHub repository so what
5:12I will do I will quickly go into my
5:14GitHub uh all the committing of the code
5:16will happen in the GitHub guys this will
5:18basically give us a real world industry
5:20experience in short because we are
5:22continuously working we are committing
5:24the code we are merging the code we are
5:25pulling the code and all many things we
5:27are going to do with respect to that so
Setting Github Repossitory
5:29uh the first thing first I will go to my
5:31repositories over here
5:33so I hope everybody has a GitHub account
5:35so let me go ahead and create a new
5:37Repository
5:38now with respect to this new repository
5:40I'm just going to give some name so
5:42let's say my name will be ml projects
5:45okay
5:46as I am saying that this will be a
5:48generic
5:49completely generic project structure
5:52later on you can replace any data set we
5:55will try to use all those techniques
5:57what all techniques is basically
5:58required that will follow so ml project
6:00so right now I'll keep it as a public so
6:03that I will be able to share this with
6:04you okay and then let's go ahead don't
6:07click anything as such right now okay
6:09don't think you don't click anything
6:10just write ml project no you don't even
6:13write description I'll show you how we
6:14can basically write everything and all
6:16so I will just go ahead and click create
6:18the Repository
6:20now once you create the repository this
6:22is what you specifically get okay
6:25now this is about my ml project now what
6:27I did is that I will probably go into my
6:30e Drive okay
6:31so I have created a folder now inside
6:34this I will be doing my entire project
6:36development Okay so
6:39I will copy this path
6:41I'll open Anaconda prompt okay
6:44now the reason why I'm opening Anaconda
6:46prompt I will just go to this specific
6:48path so let's go to e Drive so I'm in
6:51this particular path that is ml projects
6:53right now here you can see that I am in
6:55the base environment right and obviously
6:57uh if you have Anaconda prompt or if you
6:59have vs code anything as such okay we
7:02can actually start again to talk about
7:04many people also talking about the
7:05prerequisites you really need to know
7:07Python programming language modeler
7:09coding you need to know about machine
7:11learning algorithm so if you are
7:13dedicatedly following my machine
7:14learning playlist or the Deep learning
7:17playlist or the Python programming
7:19language it will be more than sufficient
7:20now from here what I'm actually going to
7:22do is that I'm just going to type code
7:24Dot
7:25now this code dot will basically launch
7:28a vs code instance okay so if I execute
7:30this so this is how my vs code instance
7:33will look like okay
7:35so here you can probably see this it
7:37will show GitHub could not be connected
7:39it's okay we can just cut this so this
7:42is an empty project completely initially
7:44to start with and this is my vs code
7:46that you will be able to see okay this
7:48is my GitHub repository okay and this is
7:51my BS code
7:52okay vs code right
7:55now first thing first I have to make
7:58sure that
8:00IV sync with my GitHub repository over
8:02here okay so to start with what I'm
8:05actually going to do over here is that I
8:07will just go ahead and open a terminal
8:09so here is my new terminal okay so this
8:12is my new terminal right it can be a
8:16Powershell or I can also use command
8:18prompt right it is up to us right
8:19whatever terminal that you want to
8:21specifically use okay
8:23now the first step is always to create a
8:26environment right now what I want is
8:29that guys I don't want to create a
8:31separate environment but instead what
8:33I'll do here only an environment will be
8:35getting created and whatever packages
8:37I'll be installing that will come inside
8:39this particular folder okay so let me
8:42just show you what I will do so
8:43basically what I'm doing saying is that
8:45inside this particular project itself
8:47uh my environment will get created and
8:50whatever packages I install
8:52that all will get created over here okay
8:54so let's go ahead and see how to do that
8:57so guys now let's go ahead and create a
Create A New Environment
9:00new environment and for creating a new
9:01environment I'm going to basically use a
9:03command you can also search this in
9:06Anaconda also you'll be able to search
9:08it so first is conda create okay minus P
9:12okay and the environment name I'm going
9:16to basically give v e and B
9:18python uh this entire project I'm going
9:21to going to develop with 3.8 and finally
9:25I will just use y notation just to make
9:29sure that the installation happens and
9:31for that it need not have to ask for the
9:34approval again like it'll just ask for
9:36the approval where we have to either
9:38type y or no like yes or no so here by
9:41default I am giving y so once we execute
9:43this here you will be able to see that
9:45the installation will happen uh and now
9:49environment will get created now here
9:50you can see v e and V is getting created
9:52anything that I will probably install
9:54like your libraries and all it will just
9:57get installed itself over here right so
9:59this is where uh I'm going to make sure
10:02that all my packages are available over
10:04here and this is a good practice because
10:06at the end of the day I can freeze all
10:08my libraries from this particular folder
10:10itself now after doing this I'm just
10:13going to clear my screen
10:15so I'll write CLS and what I'm actually
10:18going to do I'll just write quanda
10:19activate Okay v e and B which is my
10:24environment and I'll just write like
10:25this so automatically you'll be able to
10:27see that I will be inside this
10:29particular environment so I've activated
10:30my environment in short okay so uh
10:34perfect we have done this we have
10:36actually created our environment we have
10:39done everything as such okay this is
10:41perfect till here now the next thing
10:43what we are going to do is that we are
10:45going to clone this entire repository
10:48and we need to sync this with the GitHub
10:50so that we'll be able to commit all our
10:52code okay so we will just follow this
10:55step by step and we'll see that how we
10:57can make sure that whatever things we
11:00are committing right we basically commit
Initializing Github Repository
11:02in this specific Repository
11:04so first of all we really need to
11:06initialize the get okay so I will go
11:09over here open this project so let me go
11:12ahead and write git in it okay so once I
11:15write this Ma I will be initializing an
11:18empty git repository in this specific
11:21location
11:22okay so you will be able to find out
11:24this particular folder right now it is
11:26hidden okay but if you go into the
11:28folders itself you'll be able to see it
11:29perfect now after that we'll go to the
11:32next step where I will just add my
11:34readme file okay so I will just add a
11:37readme file but before adding let me
11:39just create one readme file over here
11:41okay
11:42so let me do one thing oops
11:49okay let me do one thing instead of
11:51creating a readme file over here what
11:53I'm actually going to do is that I will
11:55just create a readme file over here
11:57itself okay I can create it over here
11:59also I can create it over here that is
12:01up to you so let me do one thing let me
12:03quickly do one thing over here I'll just
12:05minimize this uh I will just create a
12:08readme file here itself so I will just
12:10create a one file okay it is going
12:12inside this particular folder no worries
12:14so now let me go ahead and create one
12:18readme.md5 okay
12:20now readme.md file is just like a file
12:24where you can probably write your
12:26descriptions uh whatever things you are
12:28there like what are the steps that you
12:30should basically write over here okay so
12:32here I can basically write n to n
12:35machine learning project
12:38okay so this is done end-to-end machine
12:40learning project I'll just save it now
12:43uh let us go ahead and add this readme
12:46file in my GitHub repository so in order
First Commit
12:48to do that I will just write git add
12:51my readme file name whatever file is
12:54there so here you can see that it has
12:55got added and I am following the same
12:57steps so here you can see I have added
12:59the readme file itself now in order to
13:02commit it I will just go ahead and write
13:04git commit minus M first commit so you
13:06here I'm just going to use this
13:08particular uh I'll just say that okay
13:10fine I want to commit this particular
13:12thing
13:13so here will be my normal message this
13:16is my
13:18I will just say first commit okay
13:21so with the help of first commit let me
13:23just make my face little bit small
13:27okay so that you will be able to see
13:29this now once I do this first commit
13:31I'll just press enter here you can see
13:33that all the file changes are happening
13:35one file changed one insertion is
13:38happening and they have basically seen
13:40this okay now if you really want to see
13:42that what is the status with respect to
13:44the commit so I can just try to get
13:46status and here you can basically see
13:49use git for adding this kind of
13:51environment everything you can probably
13:52add it okay what I will do also is that
13:55I can also add a git ignore file okay
13:57that will talk about it but right now I
14:00have made sure that I have basically
14:02committed my uh you know readme.md file
14:06okay over here now the next step will be
14:09that I have to push this file so let me
14:12just clear the screen all over here let
14:14me push this particular file into my
14:16GitHub repository so for doing that
14:18before that we will go ahead and check
14:21out our Branch to main so just copy this
14:23okay and I'll paste it over here and
14:27then the next step what I will do is
14:29that I will just write git remote add
14:31origin so I have to make sure that this
14:33origin is added so that it is in sync
14:35with this GitHub repository right so I
14:38will just go ahead and paste it over
14:39here done now if you probably go and see
14:43git remote minus V you'll be able to see
14:46that I have actually uh basically synced
14:50it with my own git repository over here
14:52right with respect to origin now finally
14:55in order to push this data into the
14:57GitHub repository we just need to use
15:00this command that is git push minus U
15:02origin main okay now before this let's
15:05say you are doing it for the first time
15:06then you also have to set git Global
15:09right so here get Global config is there
15:12so just go over here with respect to
15:15that and you just need to type this
15:17command okay so you need to sync your
15:20username and password right so sorry not
15:23password email and username user.name so
15:26user.name an email like I have already
15:28done that because this git repository
15:30without GitHub account that I have that
15:33is with my own e-personal email ID right
15:35so if you probably if I just go and copy
15:38this and paste it over here
15:40right here you'll be able to see my
15:43email ID is already synced if you want
15:45to change the email ID just after this
15:48same command you can use double quotes
15:49and write your own email ID so I've
15:51already done that so what will happen is
15:54that I can directly push so here you can
15:57see for the push what command will be
15:58using push minus U origin to main that
16:01basically means from the origin to the
16:03main the commit will basically happen so
16:06here I will write origin to main right
16:09so once I do this here you will be able
16:11to see that my code has got committed
16:13and this is how quickly I will be able
16:17to see now the file now if I reload it
16:19here you'll be able to see my readme
16:21file has got updated okay
16:23now uh
16:25this is how I have made sure that all my
16:28sync with respect to this particular
16:29code and the GitHub repository is done
16:31so anytime I probably write any code
16:34over here I will later on always try to
16:36commit the code that side okay so please
16:38make sure that you do this particular
16:40setting first of all okay you may get a
16:43minor issues that may be with respect to
16:44configuration and all but if you are if
16:47you have if you have seen my git
16:49tutorials and all I've already explained
16:50all this kind of things to you okay
16:53now after this what I'm going to do I'm
16:55also going to create a new file and this
16:57file will basically be my git ignore
17:00okay
17:01so get ignore file so here uh it will
17:04just be asking me options like what type
17:07of like what programming language get
17:09ignore you want so I will just go ahead
17:11and write Python and I will just commit
17:13the changes so this will basically be
17:15the reason why I'm creating this is that
17:17because my some of the files that need
17:20not be committed in the GitHub that all
17:22will get removed okay so though some of
17:24the common things like dot python
17:26version which is not required when we
17:27build the packages all this will come
17:29right suppose I have VNV environment so
17:32that also I can probably write over here
17:34that will also not get committed okay so
17:36I am committing the change so here I
17:38will say create
17:41get ignore okay and I'll commit the
17:43change okay so now here you will be able
17:45to see in my ml projects I have two
17:47files get ignore and readme file so for
17:49this uh in order to make sure that
17:51everything is updated on my side also so
17:54I'll just clear the screen and I write
17:55git pool okay so once I do git pull so
17:59all the updation will happen now here
18:01you can see
18:02I have this getting node file also so if
18:05you search over here v e and V see by
18:07default this V and V is also there
18:10because this is my this is my uh
18:13environment new environment right and I
18:15don't want to commit that specific in my
18:17GitHub repository okay
18:19so perfect uh we have done this the
18:21first step of setting up each and
18:23everything with respect to the
18:24environments and always mapping and
18:27already mapping to the GitHub repository
18:28has been done this is perfect I've shown
18:31you everything Scratch by creating
18:33manually later on we can also automate
18:35this entire process that also will see
18:37how we can basically do it first we'll
18:39start with some Basics we'll try to
18:41develop this once you get an idea later
18:43on we'll move towards automation okay
18:46now the next thing ah that we are going
18:49to basically do is set up our uh
18:51setup.py and I'll talk about what is the
18:54importance of setup.py and all right
18:56so let me go ahead and let me just
18:58create a new file so the new file that
Setup And requirements.txt
19:00I'm going to create is setup.py and one
19:04more file that I'm actually going to
19:05create is something called as
19:06requirements
19:09requirements.txt okay
19:11now requirement.txt will have all the
19:14packages that I really need to uh
19:16install uh while I'm actually
19:19implementing my project okay so
19:21everything will basically be coming in
19:23this requirement.txt now what exactly
19:25setup.pui now see guys I hope you have
19:28seen lot of packages in Python right so
19:31python Pi Pi if you go and search for
19:33python Pi Pi so there are a lot of
19:35packages if I probably search for any
19:37projects any packages over here let's
19:40say if I'm probably searching for c-bomb
19:42right
19:44so this c bond
19:46um
19:47do you mean c bond yes so in this c bond
19:51you will be able to see this is my
19:52package right in c bond now how this
19:54package you will be able to install just
19:56by writing pip install c bar right now
19:59how this package is basically created
20:01right and for this also setup.py file is
20:03required so if you search for python
20:06setup.py right
20:07python setup dot py understand the
20:11importance okay
20:13so if you probably see this this
20:15setup.script is the center of activating
20:17building Distributing and installing
20:19modules using distributions okay I will
20:20talk about this what exactly it is but
20:22what I'll do it over here is that I will
20:25just create a setup.py and this setup.py
20:28will be responsible in creating my
20:31machine learning application as a
20:33package and that can be you can also
20:36install this package in your projects
20:38you can also use it right so with the
20:40help of setup.py I will be able to build
20:43my entire machine learning application
20:44as a package and even deploy in Pi Pi
20:47right so python Pi Pi which we basically
20:49saw and from there anybody can do the
20:52installation and anybody can also use it
20:54so that is the reason why we
20:56specifically use setup.py okay so it's
20:58very simple building our application as
21:00a package itself
21:02so in setup.py there are many things
21:04that is required over here okay so what
21:06I will do is that quickly uh I will
21:08write down the code initially what all
21:11things you basically require in setup.py
21:13okay so uh to start with what we will do
21:17is that I will write from setup.tools
21:19and there are some basic things that you
21:21really need to do from setup.tools
21:23import
21:25find packages
21:27so this will automatically find out all
21:29the packages that are available in the
21:30in the entire uh in the entire machine
21:33learning application in the directory
21:35that we have actually created and then I
21:37will just go ahead and write setup so
21:39find packages and setup is basically
21:42required now what I'm actually going to
21:43do over here is that quickly
21:46go ahead and do the setup and here you
21:50can basically see that all the
21:51parameters that is basically required
21:53see whenever we are creating the package
21:55right we really need to write like what
21:57name is the project of what application
21:59is a project of so let's say if I write
22:01name is equal to ml project okay so this
22:04is my ml project you can also use this
22:07as a kind of constant but I'm writing it
22:09over here and you have all these
22:10parameters see version description long
22:12description so this is basically talking
22:14uh you can basically consider this as a
22:17metadata information about the entire
22:18project okay so here I will just write
22:21my version so version will be 0.0.1 so
22:25here you'll be able to see that whenever
22:26my next version will come I will just
22:28keep on updating this and automatically
22:30that entire package is will be built and
22:32it will be going to the Pi Pi where you
22:34can also use it okay so author let's go
22:37ahead and make it to crush okay so Crush
22:40will basically be the author and then
22:43you can also use author underscore email
22:47so this will basically be krishnaik just
22:49a second why this thing is again coming
22:51back
22:52zero six at the rate gmail.com okay and
22:56again comma
22:57so author email is done and then what we
23:00can do packages so here you'll be having
23:03something called as packages and I can
23:04use this find packages now see this will
23:07be very powerful okay how it is able to
23:09find packages we'll discuss about it but
23:11I'm just using this function this this
23:13module that I have actually imported and
23:16finally we can also write install
23:18underscore requires okay
23:21so install underscore requires will
23:23basically uh I have to just mention all
23:26the requirements that I want like pandas
23:28numpy okay numpy
23:31so here I can basically write numpy or I
23:34want c bond so whatever libraries I want
23:37I can basically write it over here so
23:39automatically it will do the
23:40installation of all the libraries okay
23:43so uh this is done
23:44and yeah this is the entire thing with
23:48respect to the important parameters that
23:50I basically require okay now this is
23:52once we create it now this setup.py how
23:56it will be able to find out how many
23:57packages are there and all so for this
23:59what we do is that I will just go over
24:02here okay I will just
24:05go over here create a new folder let's
24:09say I am going to name this folder as
24:11SRC source so if you want the source
24:14right the source to be found at as a
24:17package right what we need to do is that
24:19inside the source we will try to create
24:21a file which is called as in underscore
24:23underscore init dot underscore.py okay
24:26so once we do this uh with respect to
24:29this what will happen whenever this
24:31setup.vi uh this file packages is
24:35running right it will just go and see in
24:37how many folder you have this underscore
24:39underscore init.py right so it will
24:41directly consider this source as a
24:43package itself right and then it will
24:46try to build this so once it builds
24:48right you can probably import this
24:50anywhere wherever you want like how we
24:52import c bond how we import pandas
24:54similarly right but for that we really
24:57need to put it in the Pi Pi package
24:58itself but in our case what we are going
25:00to do over here is that just to make
25:02sure that this builds this gets built
25:04out of the package itself we will be
25:06using this and we will try to create
25:07this particular file underscore
25:09underscore in it dot uh underscore
25:11underscore.py okay
25:13so these are the basic things that we
25:15have actually done now in my entire
25:17project development will basically be
25:19happening inside this particular folder
25:20okay inside this folder and whenever we
25:23create any new folders also there also
25:25we'll be using this file so that that
25:27internal folder also behaves like a
25:29package once we built it okay now uh
25:32this is fine now there will be a
25:34scenario wherein guys we will be
25:36requiring many many packages as such
25:38okay I will probably require 100
25:39packages in a project right and it is
25:42not feasible to write something like
25:43this so what we do is that usually in
25:46this case we uh make sure over here is
25:49that we we try to create a function okay
25:52and that function I can basically give
25:54my path over here so let's say I create
25:57a function which says get underscore
26:00requirements
26:03okay get underscore requirements and if
26:05I probably give my requirement.txt
26:09it should be able to read all those
26:11files and now I have to create this
26:13function okay so with this function I
26:15will try to create it now this function
26:17the main work is that whatever path I am
26:20giving away it should basically take
26:21this up and whatever libraries should be
26:24over here like pandas numpy
26:26okay numpy c bond this all will get
26:30installed uh it will be taken one by one
26:33packages and it will try to install it
26:34over here so let's for right now I'll
26:36just take this three packages and I'll
26:38write it over here as setup.py okay now
26:40let me just go ahead and write this
26:42definition so quickly in order to write
26:44I will just write definition
26:48ah get a settle no not required so here
26:52I will say get underscore
26:54requirements
26:56okay and here ah
26:59two things I will try to do it over here
27:01so so that our task becomes very much
27:03easier okay one is uh to definitely give
27:07what kind of input parameter I'm trying
27:09to give right so I will just make this
27:11as file underscore path
27:13file underscore path okay and this file
27:16underscore path is Str
27:19and this will basically go with this
27:22will return a list okay and in order to
27:25return a list also we can basically
27:27write in a function right so this will
27:29be in the form of Str and obviously for
27:31this uh this list is not being
27:33recognizable because we need to import a
27:36library from typing import list okay so
27:40in short what I'm saying my function
27:42will return a list right because this
27:44requirement.txt will basically have a
27:46list of uh list of libraries right so
27:49once I probably go inside this
27:51particular function with respect to a
27:52list
27:53I will quickly write a definition also
27:56this
27:58function will return the list of
28:04requirements okay so done this is done
28:08perfect over here now we'll go ahead and
28:10write the code so let's say requirements
28:13I'm just going to make it as a list and
28:16then I'm going to open the
28:17requirement.txt
28:20so requirement dot txt this will be in
28:24the form of string or whatever file path
28:26that I am specifically giving right so
28:28this file path whatever I am getting so
28:30I can also use it over here okay
28:33with this I am going to open this and
28:36let me create this as a temporary object
28:38file object okay
28:40and then what I'm actually going to do
28:42over here is that I'm just going to
28:44write requirements now as I'm reading it
28:46right one thing if I write file
28:48underscore obj
28:51dot read
28:52lines right so once we read the lines
28:55what will happen uh so inside this
28:57requirement.txt this line will get read
29:00it right one one element will get picked
29:02up but there is one thing one thing a
29:04specific problem over here inside this
29:06requirement.txt when we go to the next
29:08line there will be slash n that will get
29:10added and whenever we try to use read
29:12lines that slash n will also get
29:14recorded over there so what we are going
29:16to do over here is that once we get this
29:18requirements right we will try to
29:20replace the slash n with the blank okay
29:22so for that I will just write a list
29:24comprehension where I will say for
29:28requirements and requirement.txt
29:33sorry requirements
29:39okay so for a requirement uh just a
29:43second
29:47okay so I'm going to take this
29:49particular requirements and then I will
29:51just say req dot
29:54there's a function called as replace
29:57and then I will try to replace
30:00slash n with blank
30:03okay
30:05so this will basically be my for Loop
30:07and this is my entire list comprehension
30:09that I am getting and this I will try to
30:12replace it in my requirements
30:14okay so I've done very simple I've just
30:17read the object I have I made sure that
30:20I'm replacing slash n by blank and I'm
30:23just replacing it in this requirements
30:26okay so finally you will be able to see
30:28over here that I am getting this
30:29particular value perfect so this is for
30:32this now always understand guys that I
30:36can directly install this setup.py or
30:38what I can do is that I can whenever I
30:40am trying to install all this
30:42requirement.txt okay at that point of
30:45time the setup.pyo file should also run
30:47to build the packages so for enabling
30:50that what we need to do is that we will
30:52specifically write over here as minus E
30:56minus E dot so when we probably give
30:59this minus E dot this will automatically
31:01trigger setup.py file okay now there is
31:05one more thing over here is that in get
31:07a get underscore requirements when we
31:09are reading right that minus E dot y
31:10will also come okay and probably in uh
31:14get requirements when we are installing
31:16this packages in the form of list minus
31:18E dot will also come it need not come
31:20okay over here it should not come over
31:22here because wherever we have this
31:25requirement.txt from this if we have
31:27this particular value if I'm installing
31:29this it should get connected to the
31:31setup.py but when I'm actually running
31:34my code over here that minus E dot
31:36should not come so what I'm actually
31:38going to do quickly over here is that I
31:40will just say I will just write one more
31:42condition saying that okay fine uh my
31:46hyphen e should not be available in the
31:48requirements and I we can actually
31:50remove it so what I will do I will just
31:53say if
31:54if
31:56minus E dot or let me just create a
31:59constant okay the constant will be
32:01something like this hyphen
32:04underscore e underscore dot which is
32:07nothing but it is given by uh you will
32:09be able to see that minus E dot so this
32:12is how it is there right so I we can
32:15write a condition if
32:16hyphen dot e dot in requirements then
32:20what I have to do since I don't want it
32:22in the setup.py because it will
32:24automatically trigger see from
32:26requirement.txt automatically it will
32:28get connected to setup.py file I'll just
32:30show you how that will basically happen
32:32so if this is present in requirements so
32:34all I have to do is that I have to just
32:36requirements.remove
32:39and I will just write hyphen e dot okay
32:42so done so finally you will be able to
32:45see after doing this I will just return
32:47my
32:48requirements
32:50okay
32:52now see the magic uh so many things we
32:55have basically done we have setup.py we
32:57have requirement.txt in requirement.txt
33:00we are this okay so I'm going to
33:02basically open my terminal
33:04okay so this command terminal was
33:06already there okay now see the magic
33:09okay once I probably do the PIP install
33:12okay right now my source just has this
33:14particular file and I don't have
33:16anything else right so quickly let's go
33:19ahead and write pip install
33:22minus r requirement Dot
33:29dot txt so once I execute this here you
33:32can see that I am getting some error
33:34okay fine what is the seller it is
33:36saying that uh install requirement get
33:39requirements so no file requirement.txt
33:42okay no worries I think I've made this
33:45mistake
33:46so it will be when I open this file
33:50requirements.txt okay
33:52fine not a worries it should not give an
33:54error see I am not editing the error
33:56part and all so you should be able to
33:59see the errors also okay so
34:01automatically see everything all the
34:03installation will happen but at the end
34:04you will be able to see one very amazing
34:07thing okay since there is in
34:08requirement.txt that is minus E dot
34:10right so that minus E dot is basically
34:13mapped to setup.py that is an indication
34:15that is basically given that setup.py
34:17file is there and automatically this
34:19entire package will get built okay where
34:22I will have all this information like ml
34:24project this this one so here uh still
34:27the build is happening it will take
34:29probably some time okay so let's let's
34:31wait for some time
34:33so over here installing collected path
34:36you can see so everything is happening
34:38installing collected packages everything
34:40uh as such now she successfully
34:42installed this this this this is there
34:44now once I go and see this so here you
34:47can see ml project dot e g g Dash info
34:50so this basically indicates that your
34:53package is basically getting installed
34:55okay now you can probably use this
34:58packages anywhere if we probably deploy
35:00it in Pi Pi but here if you go and see
35:02requirement.txt you have this C minus E
35:05dot has gone right sources.txt what all
35:08things has got uh automatically
35:10considered right see automatically it
35:12has been able to find out underscore
35:14underscore unit dot py right top level I
35:17have Source right package info this is
35:19the information that we have written in
35:21setup.py right dependency link
35:23everything is there so this is the basic
35:26thing that we have done we have done the
35:27entire setup
35:28we have set up our requirement.txt we
35:31have set up our setup.py now all I will
35:34do is that inside this I will start
35:36creating more and more folders my
35:37logging my exception will happen
35:39understand my main project is this but
35:41the outline
35:43that I have actually created with
35:44requirements and setup.py I've actually
35:46done that and this is what we really
35:48need to learn in the first part again
35:51the agenda based on the agenda we have
35:52done all these things we have also
35:55setup.py requirement.txt the second
35:58thing is that we have also created a
36:00source folder
36:02Source folder and build the package
36:04right we'll build the package so all
36:07those things is basically done the
36:08agenda and this was with respect to the
36:11first tutorial now going ahead uh since
36:14we are still focusing on creating a
36:16generic project structure later on we go
36:19ahead and create the generic project
36:20structure itself Now quickly what I will
36:23do I will go ahead and add in the git
36:26right so git dot add dot so here you can
36:29probably see my get status
36:31so what all things has got added these
36:33three main files has got added git
36:35ignore is not going so all those things
36:37are there git ignore is already added
36:40over this so again I don't have to send
36:41it so finally I will get commit minus m
36:46the second comment or I can basically
36:49write setup.py
36:52setup Dot and requirement
36:55setup I'll just write it on so this is
36:57done now the next instance what I had to
37:00do I just have to write git push
37:03minus U origin to Main
37:06okay
37:07so yes this is entirely done it has been
37:10pushed to the main branch now if you
37:13probably go and see this and reload it
37:16here you'll be able to see all these
37:18particular folders and files are there
37:19perfect so this was the basic project
37:22setup GitHub setup that we have
37:23basically done the project structure and
37:26all we'll be discussing in the second
37:27video
37:28uh this videos will be this long so you
37:31will be able to understand it okay
37:33but just go step by step try to
37:35understand if you're not able to
37:36understand anything as such what is
37:37setup.py go and search for it okay so if
37:41I probably say setup dot py right python
37:47or what is the relationship between
37:48setup and pyc setup.py is a python
37:51script typically included with python
37:53written libraries it is objective to
37:54ensure that program is installed
37:56correctly with the rate of Peep we can
37:57use setup.p setup.py to install any
38:00module also right so what is the
38:02relationship between that just go and
38:04search for it what is minus E dot right
38:07just search for it and everything will
38:09be available with respect to Google
38:11right you'll get all the solutions with
38:13respect to Google see doc python
38:15tutorials everything is available what
38:18all things are there what all things are
38:19not there what is setup dot py you can
38:21definitely search for it so I hope uh
38:24you were able to understand this in the
38:26next video again it will be for another
38:2830 to 40 minutes we will start
38:30developing the project structure in the
38:32next video but now a simple request guys
38:35please make sure that you join the
38:36membership of the program that we
38:38specifically have for you all in my
38:40YouTube channel and where I will be also
38:42able to share more materials and all
38:44with you and other than that keep on
38:46track practicing share everywhere
38:49LinkedIn share it share it share it
38:51trust me if you are able to do this much
38:53projects it will be quite amazing and
38:55again the GitHub link will be given in
38:56the description of this particular video
38:57so I hope you like this particular video
38:59I'll see you all in the next video thank
39:00you