OK, in this video, we're going to start to set up our project and we're going to set up a virtual
environment in order to hold all of our project files.
So I open the get bash terminal again.
Just go to your Windows Start menu type and that's it.
That's an icon.
Should pop right up and you can click on that.
And this should pop up now.
Mine says Kotomi at Kotomi years will say something different.
Kotomi is the name of my Windows login or whatever.
So whatever your Windows user name or login is that'll show up there.
We don't really care.
It doesn't really matter what it says there.
This is the important thing.
This is the command prompt.
This is where we're going to be typing in most of the commands or all of the commands that we need to
do throughout this course.
Now, there's not a whole lot of commands we need to issue, but in order to run our program, we need
to run it from the terminal.
So first things first, let's create a directory to hold all of our files that are going to be creating
throughout this project.
So to do that, we can use the Diaa command and I'm going to put this in the C drive and let's create
this directory called moppy three.
Right.
So if you're on Linux or Mac, obviously they don't have a C drive.
You can just create any folder anywhere on your computer and designate that as the folder.
It's the same command on macro Linux, Linux, mkdir slash, whatever you want to call it.
OK, so now let's move into that directory.
So CD stands for Change Directory and we can just type C, AMP three and you can see right here, it
shows we're in that directory.
We can type the LS Command to list the stuff that's in that directory and there's nothing in there right
now because we haven't created any created anything yet.
So now we want to create a virtual environment and a virtual environment is like a little walled garden
and it allows us to install things for Python inside the virtual environment that aren't any longer
in the computer at large.
So if we want to install some Python program there, we're going to be using and we're going to be using
some little modules and things throughout this course.
We don't want them to be installed in our computer.
We want them to be installed in our virtual environment.
It's a way to sort of contain them and keep them apart from the rest of the computer.
There's a lot of different reasons why you would do that.
A version control is one another thing, just not to mess up your computer.
You want to keep everything in your little walled garden for each project.
And this is just a coding thing with Python.
When you create a new project, you always just want to create a virtual environment for that project.
So to create a virtual environment, we type Python Dash M v envy and then we name the virtual environment.
I'm just going to call this virt short for virtual Aymond.
Anything you want, but virt makes sense to me.
Now, what this is going to do is going to spin up some files, do some stuff and sort of install our
virtual environment.
So now we can type in less and we can see now there's this virt directory that's been created and inside
of there there's all kinds of things.
So.
All right.
So far, so good.
Let me clear the screen now in order to turn on our virtual environment, we type in source and then
virt scripts and activate and you'll notice virt.
This is the name of that directory we just created with that command we just issued.
Inside of there, there's a folder called Scripts, and inside of there there's a file called Activate.
So this command will run this file and it will activate our virtual environment.
So we click that boom.
You'll notice every time I hit Enter now it says invert above our command prompt.
Right.
That means our virtual environment has been turned on, we can turn it off any time we want just by
typing in deactivate and you can see now that virt is no longer there.
That means our virtual environment has been turned off.
So I'm going to hit the up arrow a couple of times and it will cycle through the last few commands.
And then I can just go to the source scripts, activate, click it again to run it again.
And we're good to go now on Mac or Linux.
I think the command is source been activated, I think.
There you go, or source, forward, slash, been forward, slash, activate, one of those should work
with Mac.
If you had trouble with the Python command for Mac users, Python, Dash, M, V and V virt, if that
didn't work for you on Mac or Linux, try Python three.
Dash cam then virt that might work for you otherwise Windows users, this is the command now.
We only have to do this once.
This sort of installs virtual environment, once it's installed from now on, in order to turn it on,
all we have to do is this source virt scripts activate from inside of our inventory folder.
So, OK, we're good to go there.
So our virtual environment is installed.
It's set up.
It's running.
We've got basically all the setup things done.
We've installed all the tools we need.
In the next video, we'll jump in and start writing some code.