In this video, we're going to set up a full data science environment for Mac users.
In the next video, we'll do PC users.
So if you're a PC person, please skip to the next.
You can you can listen in here if you wish, but otherwise I will see you next time.
Okay, so my Mac people now I'm a mac person myself.
I've always owned Macs, so you are my home crowd.
You are definitely my favorites.
It's not like I'm going to say the same thing to the other guys.
Or maybe I am.
Anyways, this is looking right now in a Chrome browser at the repo LM engineering in GitHub, and this
link should hopefully be plastered all over the place, including in the lecture notes for this lecture.
Uh, but please come here and look at the GitHub repo, uh, to see the code that we have.
Uh, what you'll also see if you scroll down is the contents of the Readme file, which is where I have
laid out what needs to be done to set up your environment.
And I hope that I've done a decent job here of laying things out step by step and being clear on what
action to take, if anything is to go wrong.
so hopefully it's good, but if you have any corrections to make to it.
As some people already have, for which I'm very grateful, please do let me know and I'll do that.
Okay.
But for now, what you're going to do is press this green button here code.
And then you can pick either of these two.
But you're going to pick this copy button here, which is going to copy the URL that identifies this
repo into the clipboard.
And that is done.
All right.
We're now going to bring up a terminal window where we're going to go next.
Now this some of this you can do using the max finder windows if you prefer that.
But I'm more comfortable in terminals and I imagine many of you are too.
So I'm now in my home directory.
Many of you will have a projects directory set up, which is where you manage your your projects.
At the moment I don't have one set up.
If I do CD projects, there's nothing there.
So I'm going to make a directory projects and go into it.
Here we go.
And then the next thing I'm going to do when I'm inside the projects folder is I'm going to type git
clone, I want to clone a repo and paste in the name of the repo right there, and when I press enter,
it does its thing.
And I now have locally an LM engineering folder.
I'm going to go into it and there is all of our code.
It's worth pointing out that where we are right now in the LM engineering folder is what people sometimes
call being in the project root directory.
That's, that's the name for for where we are right now for this project.
The project root directory LM engineering.
All right.
So the next thing to do is for us to look at installing Anaconda.
If you haven't installed it before.
And the Readme has a direct link to the installation page at anaconda.com, which will allow you to
set it up for Mac OS.
There's a simple set of screens that will go through and configure it.
I'm not going to do it because I've already done it for me.
But but it is very clearly step by step as you will see it here.
And before you know it, you'll have Anaconda on your box when you have anaconda on your box.
Back to the terminal window.
Here we are.
We simply call a command that tells Anaconda to do everything to build a whole data science environment
for us, and that command is conda env for environment create minus f, which means we're going to specify
a file which has the full description of the environment.
And that name of that file is environment.yml which you can see right here.
That is the file that defines this environment.
And when you've done that you press enter.
Now what's going to happen now is that Anaconda is going to connect to its server, find out everything
that we need to do.
And it does what it's called solving environment, which means it figures out what versions of each
of the different packages we need are going to be the right versions, that we need to have a fully
compatible, full specked environment.
And what you saw it just doing there with all of that stuff going on.
Uh, was it, uh, feverishly creating the various, downloading the various packages and building them?
Now, that might take a fair bit longer for you, because it's fast for me, because I've already done
it and it's cached locally the first time it needs to download it.
For me, I have a pretty good internet connection, and it took about five minutes.
The first time I did this, someone reported that it was taking more than 20 minutes for them.
Uh, which is of course, uh, yeah, a lot of time to wait.
So if it's taking that long, then that might be if you have a slower internet connection that might
be expected.
But if it takes much longer than 20 minutes and you have a good internet connection, then something's
not working with Anaconda.
And I would cancel it with command C, and instead we'll use the other approach, the virtual environment
approach instead.
So right now, Anaconda is busy doing what it calls executing the transaction, which is essentially
after it's figured out what versions of what we need, It's building that that whole environment.
And then at the end, for those that know about this, there are also some packages that I pip install
because they're not they don't yet have conda versions.
So there are some packages that get pip installed at the end of it.
But when you see installing pip install you are near the very end and it's done.
So I didn't lie.
It doesn't need to take a long amount of time.
It's pretty fast and all of that is done.
We need to activate our new environment, which means we need to say we want that to be the live environment
that's currently being used.
If you look at my my cursor right now, you'll see the word base is to the left here.
And that means that we're not currently running in an in an anaconda environment right at the moment.
In order to use our LM environment, we the name of the environment is LMS and we're going to type conda
activate LMS.
And that is all it takes to tell Anaconda we want to be running in this environment with the same version
of Python, the same version of all of these packages?
That means that we are completely consistent.
That happened immediately, and you'll see that LMS is now written on the left.
And if you're seeing that, that is your clue that it's worked and that you are now running the right
version of Anaconda.
And as a final step here, I type in this command JupyterLab.
And JupyterLab is the command that says, I want to launch this data science environment called JupyterLab,
which allows me to work very interactively with code.
And when I run that, it thinks for hopefully just a moment while it considers the task at hand.
And then it will launch JupyterLab in a new screen.
And what you will probably see is something a bit like this.
All right.
With that, I'm now going to pause for you guys.
I'm going to record a video for the PC users, and I'll meet you back in two videos time.
See you there.