How to Install Anaconda on Mac (Getting Started)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up everyone my name is Dave I'm a data scientist and in this video I will show you how to install anaconda on your Mac alright so here's what we'll cover in today's video I'll first give a brief introduction about Anaconda then I'll show you how to install on a Kona Omega os I'll give you a quick overview we'll run some jupyter notebooks then I'll show you some kona commands and finally I'll show you how to run python in vs code using an anaconda environment so let's start with a brief introduction about Anaconda so first of all anacondasive distribution of the Python and R programming languages and is specifically made for data science Anaconda lets you install or update packages independent of system libraries or admin privileges this also makes Anaconda very convenient for when you have a company laptop for example with restricted access and lastly environments it's really easy to manage different versions of python and different environments on the user level so for example you can install multiple versions of python so you can have a python 3.8 and also 3.9 and with Gunda it's really easy to manage all of those environments but more on that later alright so now I'll show you how to install anaconda on your Mac so we'll start off by opening up the browser and going to the Anaconda distribution page I will leave a link in the description so here we are on the page for Mac OS which has a big fancy download now button but I've noticed that if you go all the way to the bottom there are different versions for like the classical version of MacBooks and MacBooks that have the M1 chip so I'm not quite sure if the button over here will download the Chrome correct version so depending on the system that you have pick your version here so I'm currently on a 2020 MacBook Pro with an M1 chip so I'll go with this one now the download prompt will open up and I'll save it to my downloads once it's done we'll open it up in the folder and then we'll just double click it to run the installer it will give you a warning to check whether this software can be installed on your system this probably has something to do with the M1 version I'll click allow and then you just click through the installer so continue continue you have to accept the license agree then it's fine to install it for me only I'll continue I recommend that you just leave to the default installation location and then you hit install it might give you some other prompts that you have to accept it also asks you to install data spell this is optional this is an IDE by jetbrains for for data science you can just ignore that for now okay so Anaconda was already installed on my MacBook so I didn't show the end screen but it should give you a summary saying that Anaconda is installed successfully on your Mac alright so now I'll give you a quick overview of Chronicle so what we can do we can start off by opening the Anaconda Navigator I can do this by opening up Spotlight and type in Anaconda and you'll see the Navigator so I'll open it up okay so here's an overview of some of the packages that are included I won't go into depth into each of them in this video but here you can see some popular Ides for writing python code for example so you have vs code you have pie charm uh Spider those are all Ides that you can use to write biting code you have the popular Jupiter notebooks in Jupiter lab there's also rstudio for if you use R code alright so I'll now show you how to run Jupiter notebooks and I'll show you two ways how you can do this first I'll show you the approach that most people use and secondly I'll show you the approach that I use which I think is way more convenient when I'm in the Anaconda Navigator I can just here under Jupiter notebook click launch what this will do this will open up a terminal and then fire up your browser running on a Jupiter session and by default this will open up in your user folder so what you can do from here is then from here you can navigate to the folder where your projects is located or where your notebooks are stored but this way you always have to navigate to the folders and maybe your project is like somewhere deep down another folder with some other projects and it's just not very convenient to always browse to your projects by going through your user folder first alright so I'll now show you another way of how you can open jupyter notebooks so now quickly show you how to do that so I found this GitHub repository with some bundles exercises and I cloned it into my downloads folder so here I have some notebooks and then the bundles exercises to say for example you're looking online and you find an interesting notebook that you want to try out you download it to your computer and now you want to open it up in a Jupiter notebook to run it yourself so how do you do this you go to the folder which contains your notebooks then you click on the icon right here and then you select new terminal tab add folder and what this does this will open up a terminal window within this specific folder and I can also list all the files that are in here so here you can see all the files so now what we can do we can type in Jupiter notebook and what this this will do this will open up a Jupiter session for us within this folder so now you have all the files here and you can just click through them open them up and then here you have to exercise with solution exercises let's open up the exercise with solutions for example all right so now we're in the notebook and what we can see if we just run the notebook here it works fine so that is how you run a jupyter notebook using Anaconda you first go to the folder where your notebooks are located you open a new terminal window and you launch jupyter notebook alright so now let's talk about call my commands so what is conda well conda is a command line package and environment manager that installs and manages online packages from the underground repository as well as the Anaconda Cloud it installs these packages in a binary format which means there is never need to have compilers available to install them and besides python packages you can also install other software with Anaconda for example C C plus plus or R so if you're a python user then you are probably familiar with bip and pip is very similar to Konda but they also have their differences so what are these differences well pip lets you install packages from the byte and package index and as I just mentioned pip can only install python packages whereas comner can install packages from all different kinds of software then another big difference is the amount of packages that are included so the Anaconda repository has about 1500 packages that are available while the python package index has over 150 000 packages available that you can choose from so here's my personal recommendation on how I use pip versus Konda so I use conla to create environments which I'll show you later and I use pip to install all the different python packages alright then let's briefly talk about cool night environments well cone environment is an isolated workspace with specific Python and package version to make sure everything works together so for example you can have one environment with the pandas version of 1.3 and another environment in which you run bundles with version 1.4 and by using environments you basically make sure that your scripts don't break so for example if you install a few python packages for a new data science project and later you start another project where you need for example different versions of the packages and if you don't use environment you can override those old packages that you had installed which can cause the old scripts from your old projects to break and that's why it's best practice to always use environments for each project so you can isolate them and make sure that nothing breaks it's just a very controllable way of managing code versions and scripts and you can have many different environments on your computer Konda also lets you manage these environments so you can create export list remove update Etc alright so I'll now show you how to get started with Kona so we'll start off by opening up terminal and the first thing that we'll do is run conla info so we can see the version here for example and what I'll now show you is how to create an environment and remember that all these commands will be available in the cheat sheet that I've Linked In the description so the way to create a contact environment is by running the following command you run conduct create dash dash name then the name of your environment and then you can specify which python version you want to use so let's create an example Anaconda environment with python version 3.6 I'll hit enter it will collect everything it will give you an overview and then you basically have to accept it by pressing the Y and then enter alright so now it's done so then once the environment is created what we can do is we can run conda and list and this will give you a list of all the environments that are available on your system and basically we can choose from one of these environments to activate them and then run python code within those environments so let me clear that up and now to activate the environment we run conda activate and then the name of your environment so we'll activate the example what you can see is that now before your username you will see the name of the environment this means that from now on everything that we do will be within this environment so what I can now do is I can check what is already installed in this environment by running Kola list and here you can see everything that is installed so with python version 3.6 there's pip installed and there are also some other default packages already installed alright so let's say for example you want to start a day data science project within this example environment and you need some packages to get started you need for example pandas and you need scikit-learn so how do we go about that so now once we're in the environment we can basically install python packages just like we would normally do so we can just use pip install bundles to install pandas for example and this will install pandas using bip within the Anaconda environment alright so panace is installed Alright and then for example we do pip install scikit learn and this will install so I could learn within our environment alright and now we basically have an isolated python environment with both pandas and scikit-learn installed which we can use to run our projects in so let me clear this up if I now run python you'll see that we're running python on version 3.6 and I can import bundles without any errors when you want to exit out of your conda environment you can run the commands call that deactivate alright but this was an example of how to run python within the terminal now you are probably wondering okay that's cool but how do I use it in IDE for example vs code let me show you how to do that so start off by opening up these codes and I just created a example script here very basic we import bundles and we print the basic data frame and by default this script will run under the base environment of anaconda this is also what we can see down here it says we're on python 3.9 and we are in the cola environment called base which is the default file so to change this we can click down here and this will open up a list with all the available environments and if you just created your refinement and it's not up here you can click the refresh button and from here we can see our example environment that we just created so I'll click here so by selecting the environment the environment will switch what we can see down here in the bottom is that we're now in our example environment and running on python 3.6 and we can save this to our visual code workspace so the next time you open up this file within this workspace it will automatically pick this environment so what I can now do if I run this code we'll see that everything works just fine you can even see here that we're using the exam environment that we've just created alright so here's the Anaconda cheat sheet in this cheat sheet are some of the most used commands here is also a getting started page from the official Anaconda website this is a 20 minute guide that will show you how to get started with anaconda and let you try out the major features of Gonda a test here that you should understand how Conta works when you finish this guide so also leave the link to this page in the description alright and that's it you now know how to install anaconda on your Mac you know how to run some basic contact commands you know how to run Jupiter notebooks create environments and even hook those environments up to Fierce code to start your data science projects if this video helped you out I would really appreciate it if you like this video And subscribe to the channel I'll be making more videos related to python data science and machine learning so if that's something you're interested in you should definitely subscribe see you next time
Info
Channel: Dave Ebbelaar
Views: 21,247
Rating: undefined out of 5
Keywords:
Id: RFeIn2ywxG4
Channel Id: undefined
Length: 11min 42sec (702 seconds)
Published: Thu Jun 23 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.