And welcome back to team PC and Team Mac as we come back together again for a quick video.
In this one, I'm just going to quickly walk through what you do.
If Anaconda has given you problems, you're not able to get that to work and you want to fall back to
the simpler virtualenv approach.
This is a quicker, simpler approach.
It's less guaranteed to be compatible.
It's less heavyweight and powerful than the Anaconda environment, but it's perfectly okay.
And so by all means, use this if you would prefer.
So I'm going to do it on my Mac.
But I'll point out when things are different for the PC and it's basically the same, although I'll
say the the instructions begin where it says alternative setup instructions in the Readme on on the,
the, the repo.
And one important difference between PC and Mac is that if you haven't, I imagine that that almost
everyone on this has has installed Python before on their PC.
But if you haven't, then you will need to do that.
Python comes on Macs by default, but not on PCs, so I've got a link in here to go to the Python website.
When you go to the Python download website, you can choose to download the latest version of Python,
but it might be better to choose Python 3.11.9, which is the latest version 3.11 to be compatible,
and you can come down here and do a windows installer to install on windows.
And if you don't have this version and if you have the time to install this version on windows, that
would be better.
Okay.
Once you have done that, then on a mac, bring up a terminal window on the PC.
Bring up a normal PowerShell prompt, not the Anaconda prompt, just a regular prompt, and go into
the projects directory that we created earlier and then into the LM Engineering directory where the
project sits.
And now you do a simple command.
Let's first just quickly check what version of Python we're running Python minus minus version.
And on my computer my default version is actually 3.12.3.
It still works as far as I can tell for everything, but it's not as guaranteed to be compatible.
But still, I'm going to push ahead with this.
Uh, and what we now do is we type Python minus m.
Venv venv.
You might wonder what magic, what strange concoction that is.
Python is saying I want to create a new virtual environment, and then the name of that virtual environment
is going to be Venv again, which is something that people usually often use.
And if I look in this directory, you'll see that there is now a folder called Venv virtual environment,
which will contain all of the Python files for this virtual environment.
And so far everything has been the same with a PC.
What I'm going to do now is different between a mac and a PC.
On a mac, what we're going to do is activate this virtual environment on a mac.
You do that by typing source venv slash bin slash, activate.
And again, all of this is of course I just did that.
All of this is of course written in the Readme instructions.
And the way we know we've activated the environment is that Venv appears over here on the left.
You can see there's also this base here because I've got Anaconda installed.
You may not see that if you haven't installed Anaconda and on a PC you won't, you won't see that.
but that can be safely ignored.
We are in the venv.
Environment.
And now what you do, which is something that probably most of you have done many times before, is
we do pip install because we want to install Python packages.
Minus R means we have a file of names of packages that we want to specify, and it's called requirements.txt.
And then when I press enter it is now going to be installing these packages.
But it's not installing them on my the python that comes with my box.
It's installing them specifically on this virtual environment called Venv.
So I'm isolating my environment from anything else that I might be doing on my computer with Python.
And you can see that there's plenty going on here as it does all of these things.
It will be slower for you because you can see it's saying it's used cached.
Because I've done this before, it won't be cached for you presumably.
So there'll be a lot of downloading going on, but it's still a lot quicker than setting up the Anaconda,
uh, window.
And then the business happens at the end.
Right now it is at the moment, now going ahead and installing all of that.
And you can see a lot of different packages here.
Uh, of course, only some of these are the packages we're actually going to use on this course.
Many of them are things on which they depend.
So it's installed both the packages we need and all of their dependencies up there.
Um, but you'll see that there's things like SQL alchemy, and that's because we're going to be using
an object database that's going to depend on that.
Um, and you can see other things going on here.
Chroma is the the vector data store, a wonderful open source vector data store that we'll be using
Tokenizers part of our Huggingface code.
So lots of things you can take your time while it's doing this, to look around and see the names of
some of the packages that we will be using.
All right.
That has now happened.
And it didn't take very long at all.
And at the end of this, all I have to now do is again, uh oh, I might just quickly mention that the
the command for a PC to activate your environment is in fact venv and then backslash scripts.
Backslash activate.
So you would type that first and then you would type the pip install r requirements.txt.
And of course that's all specified in the readme.
But whether you're on a mac or on a PC at this point all you would do is type the simple JupyterLab.
And with any luck, when I press enter, it is now going to launch the JupyterLab environment.
Here it comes.
And this is going to be our home for the next few weeks.
The next eight weeks.
Folders for each of the eight weeks and the usual setup.
The only difference being now we have this Venv folder which contains our virtual environment.
So that's the fallback plan.
I hope that makes sense.
If you have any problems at all with the fallback plan, then please, please, please reach out.
I will fix it.
We'll get you on your way quickly.
All right, on to the next video when we're going to be doing setting up API keys with OpenAI.
See you there.