1
00:00:01,540 --> 00:00:05,290
OK, in this video, we're going to start to set up our project and we're going to set up a virtual

2
00:00:05,290 --> 00:00:08,690
environment in order to hold all of our project files.

3
00:00:08,690 --> 00:00:10,570
So I open the get bash terminal again.

4
00:00:10,570 --> 00:00:14,330
Just go to your Windows Start menu type and that's it.

5
00:00:14,350 --> 00:00:15,500
That's an icon.

6
00:00:15,520 --> 00:00:18,190
Should pop right up and you can click on that.

7
00:00:18,550 --> 00:00:20,240
And this should pop up now.

8
00:00:20,260 --> 00:00:23,440
Mine says Kotomi at Kotomi years will say something different.

9
00:00:23,650 --> 00:00:26,650
Kotomi is the name of my Windows login or whatever.

10
00:00:26,650 --> 00:00:30,510
So whatever your Windows user name or login is that'll show up there.

11
00:00:31,060 --> 00:00:31,780
We don't really care.

12
00:00:31,790 --> 00:00:33,310
It doesn't really matter what it says there.

13
00:00:33,590 --> 00:00:34,910
This is the important thing.

14
00:00:34,930 --> 00:00:36,070
This is the command prompt.

15
00:00:36,070 --> 00:00:39,880
This is where we're going to be typing in most of the commands or all of the commands that we need to

16
00:00:39,880 --> 00:00:40,770
do throughout this course.

17
00:00:40,780 --> 00:00:45,760
Now, there's not a whole lot of commands we need to issue, but in order to run our program, we need

18
00:00:45,760 --> 00:00:47,080
to run it from the terminal.

19
00:00:47,080 --> 00:00:52,180
So first things first, let's create a directory to hold all of our files that are going to be creating

20
00:00:52,750 --> 00:00:53,680
throughout this project.

21
00:00:53,680 --> 00:01:01,780
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

22
00:01:01,780 --> 00:01:03,910
this directory called moppy three.

23
00:01:04,420 --> 00:01:04,710
Right.

24
00:01:05,830 --> 00:01:09,340
So if you're on Linux or Mac, obviously they don't have a C drive.

25
00:01:09,340 --> 00:01:14,710
You can just create any folder anywhere on your computer and designate that as the folder.

26
00:01:14,950 --> 00:01:20,710
It's the same command on macro Linux, Linux, mkdir slash, whatever you want to call it.

27
00:01:21,480 --> 00:01:23,920
OK, so now let's move into that directory.

28
00:01:23,920 --> 00:01:30,130
So CD stands for Change Directory and we can just type C, AMP three and you can see right here, it

29
00:01:30,130 --> 00:01:31,810
shows we're in that directory.

30
00:01:32,080 --> 00:01:36,910
We can type the LS Command to list the stuff that's in that directory and there's nothing in there right

31
00:01:36,910 --> 00:01:39,510
now because we haven't created any created anything yet.

32
00:01:39,520 --> 00:01:46,120
So now we want to create a virtual environment and a virtual environment is like a little walled garden

33
00:01:46,390 --> 00:01:53,500
and it allows us to install things for Python inside the virtual environment that aren't any longer

34
00:01:53,500 --> 00:01:54,840
in the computer at large.

35
00:01:54,850 --> 00:01:59,500
So if we want to install some Python program there, we're going to be using and we're going to be using

36
00:01:59,500 --> 00:02:02,980
some little modules and things throughout this course.

37
00:02:03,250 --> 00:02:05,470
We don't want them to be installed in our computer.

38
00:02:05,470 --> 00:02:07,690
We want them to be installed in our virtual environment.

39
00:02:07,690 --> 00:02:11,040
It's a way to sort of contain them and keep them apart from the rest of the computer.

40
00:02:11,050 --> 00:02:12,850
There's a lot of different reasons why you would do that.

41
00:02:13,090 --> 00:02:17,260
A version control is one another thing, just not to mess up your computer.

42
00:02:17,260 --> 00:02:20,520
You want to keep everything in your little walled garden for each project.

43
00:02:20,530 --> 00:02:22,480
And this is just a coding thing with Python.

44
00:02:22,480 --> 00:02:26,350
When you create a new project, you always just want to create a virtual environment for that project.

45
00:02:26,350 --> 00:02:34,150
So to create a virtual environment, we type Python Dash M v envy and then we name the virtual environment.

46
00:02:34,150 --> 00:02:37,290
I'm just going to call this virt short for virtual Aymond.

47
00:02:37,300 --> 00:02:39,700
Anything you want, but virt makes sense to me.

48
00:02:40,030 --> 00:02:45,330
Now, what this is going to do is going to spin up some files, do some stuff and sort of install our

49
00:02:45,340 --> 00:02:46,300
virtual environment.

50
00:02:46,540 --> 00:02:52,510
So now we can type in less and we can see now there's this virt directory that's been created and inside

51
00:02:52,510 --> 00:02:54,000
of there there's all kinds of things.

52
00:02:54,010 --> 00:02:54,400
So.

53
00:02:54,700 --> 00:02:55,230
All right.

54
00:02:55,240 --> 00:02:56,190
So far, so good.

55
00:02:56,200 --> 00:03:03,010
Let me clear the screen now in order to turn on our virtual environment, we type in source and then

56
00:03:03,580 --> 00:03:07,960
virt scripts and activate and you'll notice virt.

57
00:03:07,990 --> 00:03:12,280
This is the name of that directory we just created with that command we just issued.

58
00:03:12,640 --> 00:03:17,260
Inside of there, there's a folder called Scripts, and inside of there there's a file called Activate.

59
00:03:17,560 --> 00:03:22,240
So this command will run this file and it will activate our virtual environment.

60
00:03:22,240 --> 00:03:23,740
So we click that boom.

61
00:03:23,740 --> 00:03:29,050
You'll notice every time I hit Enter now it says invert above our command prompt.

62
00:03:29,890 --> 00:03:30,260
Right.

63
00:03:30,550 --> 00:03:35,020
That means our virtual environment has been turned on, we can turn it off any time we want just by

64
00:03:35,140 --> 00:03:41,690
typing in deactivate and you can see now that virt is no longer there.

65
00:03:42,070 --> 00:03:43,930
That means our virtual environment has been turned off.

66
00:03:44,140 --> 00:03:49,060
So I'm going to hit the up arrow a couple of times and it will cycle through the last few commands.

67
00:03:49,300 --> 00:03:54,220
And then I can just go to the source scripts, activate, click it again to run it again.

68
00:03:54,460 --> 00:03:56,920
And we're good to go now on Mac or Linux.

69
00:03:56,920 --> 00:04:03,190
I think the command is source been activated, I think.

70
00:04:05,150 --> 00:04:11,330
There you go, or source, forward, slash, been forward, slash, activate, one of those should work

71
00:04:11,930 --> 00:04:12,680
with Mac.

72
00:04:13,570 --> 00:04:21,310
If you had trouble with the Python command for Mac users, Python, Dash, M, V and V virt, if that

73
00:04:21,310 --> 00:04:24,700
didn't work for you on Mac or Linux, try Python three.

74
00:04:25,770 --> 00:04:31,770
Dash cam then virt that might work for you otherwise Windows users, this is the command now.

75
00:04:31,800 --> 00:04:33,360
We only have to do this once.

76
00:04:33,780 --> 00:04:41,400
This sort of installs virtual environment, once it's installed from now on, in order to turn it on,

77
00:04:41,400 --> 00:04:45,930
all we have to do is this source virt scripts activate from inside of our inventory folder.

78
00:04:45,950 --> 00:04:48,000
So, OK, we're good to go there.

79
00:04:48,240 --> 00:04:50,580
So our virtual environment is installed.

80
00:04:50,590 --> 00:04:51,180
It's set up.

81
00:04:51,180 --> 00:04:51,870
It's running.

82
00:04:52,020 --> 00:04:54,270
We've got basically all the setup things done.

83
00:04:54,270 --> 00:04:55,770
We've installed all the tools we need.

84
00:04:55,920 --> 00:04:58,710
In the next video, we'll jump in and start writing some code.
