Hello and welcome back everyone to finish off this section of the course we're going to get you set
up and install everything you need to be successful in the course.
So the first thing to do is download and install Anaconda.
If you've actually already downloaded installed Anaconda for other courses or maybe for your own environment
you should be good to go on that step.
Keep in mind if you have an insult Annacone will go ahead and walk you through how to do that as well.
Then once you've installed Anaconda we're going to create a virtual environment.
There's a couple of different files depending on your operating system so make sure you pay attention
when we go over that step.
Then we'll talk about how to open up Jupiter lab and then we'll quickly discuss how to work with both
notebooks and high scripts with Jupiter lab.
OK.
As a quick note if you're an advanced user of Python please feel free to use any ID or integrated development
environment you prefer in this course.
We tend to stick with Jupiter lab and Jupiter notebooks just because that's the easiest for screen casting.
It's really nice and it allows us to write notes and explain and visualize everything in one single
screencast into one single notebook file.
However if you're an advanced users and maybe this like Jupiter please feel free again to use any idea
you prefer.
However if you are new to these sort of topics we highly recommend these are suggested in environment
and tools to avoid issues along the way.
So only advanced users should be using their own ID.
Quick note this lecture does have resource links.
So make sure to download the appropriate thought why a mail file for your operating system.
That thought why a mail file is what we're going to be using when we actually create our virtual environment.
But first let's download and install Anaconda.
Ok set to begin.
We need to go to the w w the Anaconda dot com slash download or simply google search Anaconda downloader
Anaconda Python and you should be able to find this link.
So let's head over to the browser and check it out.
All right.
Here we are at Anaconda dot com slash download.
Keep in mind sometimes Anaconda changes the look of this Web site so it may not look exactly like it
does on my screenshot here but more or less you should be able to find the download links for three
operating systems.
That is Windows Mac OS and Linux.
So all you need to do is click on your specific operating system.
So if you're on Windows you'll click on Windows and eventually what it does is it scrolls you down automatically
here that it has two versions one for Paice on 3.7 one higher price on 2.7.
You're going to want to install the python 3.7 version and you'll notice that there's usually two types
of installers here specifically for Windows.
There is a 64 bit and 32 bit.
If you're on a relatively modern computer it's probably going to be 64 bit.
So you go ahead and download that graphical installer so you just click on that and it will automatically
start downloading.
It's up to you whether you want to download Anaconda's a cheat sheet and given them your email but if
you just this you'll notice that it's already started the download for me.
Now keep mine.
They can also go to Mac OS.
Now if you're on Mac OS again I highly recommend downloading the graphical installer centrally just
the graphical installer that takes you through all the steps.
If you're on Linux go ahead and then click Linux and it will have installer here for you.
So choose the correct installer.
Depending on your operating system once you've installed that or what you've downloaded that installer
it's time to actually install Anaconda.
So a click opened here this executable file that downloaded for me and then you'll have the Anaconda
set up guy.
You'll go ahead and click next agree to the license agreement.
I would recommend just installing it for just me.
Then next go ahead and select the default hit next.
Then eventually you'll have the advanced installation options.
There's two advanced options here.
You'll notice that one of them has at Anaconda too my path environment variable.
If you've already installed Python previously maybe you've already installed Python from Python or than
actually highly recommend clicking and adding anaconda to my path environment variable.
I know it says here that it's not recommended.
But if you have previous versions of Python what ends up happening is when you download or install certain
files your computer gets confused.
As far as what's Python version it should use your previously installed Python or your anaconda one.
So if you've already installed python in the past from pipe from the org then I highly recommend adding
Anaconda's to your path environment variable.
If this is your first installation of an icon then python ever then it's actually not really necessary
to do that.
OK so once you're done with that go ahead and click install.
After installation we now need to download libraries used for this course.
The installation has installed the Anaconda prompt command line tool.
We're going to be using this command line tool for the next few steps.
The next step is to create and activate the virtual environment we provided for you.
This environment will download all the libraries you need for the course.
Please make sure to check the resource links for this lecture video and download the appropriate thought
why M-L file for your operating system.
We provide different Y.M. files depending if you are on Windows Mac OS or Linux.
So go ahead and pause the video and make sure you've downloaded the why M-L file.
You'll also want to make sure you keep track of the location of that.
Why a mail file you just downloaded.
We will need to know its location in order to use it.
So go ahead and put it somewhere like on your desktop or in your Downloads folder.
Now let's go ahead and use the Anaconda prompt.
So search for the Anaconda prompt on your computer.
So if you're on a Mac OS just go ahead and open up your spotlight search and then type in an icon that
prompt a should see it fill out.
You could also use your terminal if you're on a Mac OS or Linux or on Windows will go ahead and search
Intercon the prompt and then open it.
I'm right now on a Windows computer.
So let me go ahead and search for an icon the prompt.
OK here I am at my desktop.
Notice I'm on a Windows computer so I downloaded the C-v course underscore windows thought why a mail
file and I've placed it somewhere I know it is so right now it's under my downloads folder.
Make sure you know where the why mail file is on your computer.
Again you recommend either putting it on your desktop or your Downloads folder.
Now let's go ahead and open up the Anaconda prompt.
So on your computer just search for Anaconda prompt.
You should eventually see it pop up.
So go ahead and click that open and now we have the Anaconda prompt.
So the next step is to actually see the or change directory to or ever you say that why a mail file.
So do that you simply type C the space and then the name of the folder you downloaded it.
So we're going to say downloads and you can get tab to auto this.
So again we recommend either desktop or downloads.
So then hit enter and not inside my downloads directory and then I'm going to write out the command
that allows me to create an environment from this C-v course Windows that why M-L file.
So the way this is done is we simply type out Konda SEO and da space e and V space create space dash
F and then you type out the name of the Y and L file that's in this particular folder.
So my case it's C-v course underscore Windows y and l an important thing to know is you should be able
to hit tab on your keyboard and have this autocomplete if you hit tab and it does not autocomplete.
That means the M L file is not in this location.
So particularly spelled this wrong so let me say C-v course wrong why M-L file.
Enter And if you find this error spec not found.
Can't process without a name.
That means that the why mail file doesn't exist in whatever particular folder you're in.
Or you maybe misspell the Y.M. file so keep that in mind if you get this error.
It means you're not in the right location.
And again you need to use CD to change directory into that correct location.
So now I'll try this again.
Again it's kinda envy.
Create that f See course and in this case and get a tab autocomplete So in my case it's Windows that
why MLA or on a Mac OS or Linux will be different.
Of course Mac OS Macalester Stevy course Linux then go ahead and hit enter.
So what this is doing is it's creating a virtual environment and it's going to download a bunch of libraries.
So this is going to take a little bit of time while it's preparing and verifying eventually it's going
to ask you if it wants you to allow it to create the environment.
So just hit y for yes and you'll go ahead and let it happen.
So in my case I already hit Y and it's ready to go once it's ready to go.
You should see a command here to activate this environment.
Use Conda activate and then I'll say Python underscore C-v course to deactivate the environment.
Use Konda de-activate.
OK so let's try it out.
You should be able to just say activate and see the course or deactivate.
Keep in mind if you are on a Mac OS or Linux will probably say.
Source.
Activate or source deactivate.
You should just do whatever command it tells you right here.
So let's try this out.
We're going to say Konda activates Python underscore C-v course hit enter and you'll notice.
Now imprint sees it says Python C-v course that basically tells me that hey the environment is activated
and you have the appropriate libraries now.
So in order to start Jupiter lab which is the environment we'll be working on.
We just did it now type out Jupiter Dasch lab and hit enter and you should see something pop up saying.
Copy paste this URL in your browser connect for the first time.
So if your browser that automatically pop up with the Jupiter notebook ready to go you may want to copy
and paste this.
Make sure not to do Control-C otherwise that actually kills the server here.
So in your browser you should see now something like this pop up let me bring it over.
All right so here I am in my browser at localhost Colan 8 8 8 8 slash Lab..
When you actually launch Jupiter Lab. You should see something that looks like this.
And if you clicked that folder you'll actually see the current location.
Your at.
OK so we have all other downloads some downloads.
So this location in the Downloads folder.
This is where are you going to want to save and unzip the zip file for each of the sections of the course
in order to get those notebook files were going to be using Juber lab and we're going to be using both
notebooks as well as script files.
So it's quickly show you how you can create a notebook simply here on notebook.
Python 3 and you'll notice a little note book pops up here.
It's IPY and B.
These files can only be opened through Jupiter lab or Jupiter notebook and you can click on this little
folder file browser here it's kind of collapse that and then you should be able to say Prince Hello
world.
Zoom in here so you can see it a little better and then do shift enter in order to run that cell.
You should see the direct output.
And if you're familiar of Juber enough books is basically just kind of a different idea.
For Jupiter notebooks.
OK so that's it for actually running notebooks.
Now let's quickly show you how you can run Python scripts again or you're going to do is click on file
browser and you see the little plus button here indicates a new launcher.
So you hit that plus button has new launcher and instead of notebook what we're going to do is just
come over here and click on txt file.
So now we Harry have untitled text in order to run this as a Python script.
All I need to do is right click on this say rename and I'm going to rename this as my script py and
hopefully are already at the level of Python where this all makes sense to you.
And let's try Prince I am running a script.
Go ahead do control s to save that.
So now I have a Python script and if actually I want to run this script all I need to do is sit.
Plus over here and come down to where it says terminal that will launch a new terminal for me and then
I will say Python and say my scripts PI again I should be able to tab autocomplete this my script up
high so up to you if you want to type it up manually.
Or just do tab autocomplete but once you hit enter there you should see I am running a script or it
every happened say in that print statement.
All right.
So that's all there is to it.
We've learned how to install and create an anaconda environment.
We learn how to open notebooks and we've learned how to run the PI scripts.
That's everything you need to know if you have any questions feel free to post the Kewney forums and
we'll get you up and running as soon as possible.
Thanks and we'll see you at the next lecture.