The only CONDA tutorial you'll need to watch to get started

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so in using python for your data science project or coding project in general conda is a great tool that will help you to manage python libraries because sometimes when installing certain libraries you might need to install prerequisite dependencies meaning that the library that you want to install will require you to have a certain version of other python libraries and so condyle will simplify that process for you and another great thing is that you could create environments in conda which can be any version of python you want it could be 3.8 3.7 3.6 or 3.9 and another great thing is that you could share your condy environment to your co-workers or your friends so that they will get an exact replica of your particular condy environment and so typically to install conda you might install it via using anaconda however anaconda is equipped with several other software which might be overwhelming at first and so i highly recommend you to use mini conda which is a minimal version that contains only conda so let's get started so i'll provide the links to miniconda in the video description and so if you're using windows feel free to select the version that you want so i highly recommend you to select either 3.8 or 2.9 because most of the python libraries will be supporting version 3.8 or 2.9 however my personal favorite is to use a python version that is not yet the bleeding edge like for example if there's 3.9 i would use a 3.8 and the reason being is that some libraries are not yet supporting the newest version of python so if you're using 3.8 most of the time most of the libraries will have already supported 3.8 because it has been around for quite some time but then if you install 2.9 some libraries might not support the newest version of python and also check your own computer whether you have a 64-bit or a 32-bit and so i would recommend 3.8 and if your computer is a 64-bit download to 64-bit and if it is a 32-bit download the 32-bit and if you're on a mac then you could download the mac version or if you are on a linux you could download the linux version here and so let's assume that you have already downloaded conda and you want to create your first conda environment so let me recommend you this documentation of conduct and so this will be provided in the video description and this is your go-to page for everything about managing your condo environment so we're not going to cover everything but then we're going to only cover the basics that you should definitely know so the first thing is to install a particular condo environment and a particular python version and so let's say for example that in the prior page you have downloaded 3.9 or 3.8 but then let's say that you want to create a python version of 3.5 or 3.6 you could do that and the great thing is that you're not limited to creating only a single environment you could create 10 20 30 up to your heart's content and each environment can contain different versions of python and so let's use this code as an example so let's create a new python environment conda create dash n and so conda will be using the conda program and create means to create the environment and dash n is an option meaning that you want to create a new environment and then the following will be the name of your environment what do you want to call it you could call it anything let's say i call it test 0 1 so let me increase the margin a bit test 0 1 and python equals let's say i install 3.7 and then enter and for this just enter y and then that's all you just wait and then it'll install your python 3.7 all right and now it's finished that was quick and so the next thing is as mentioned here in order to activate your condy environment you need to type something in to the terminal which is to type in conda activate and then the name of your environment which was test01 so let's do that honda test01 and now as you can see here in the left part of your command line you have the name of the environment of conda right here and let's see what packages are already installed in this particular environment let's type in conda list so all of these libraries are in your current python environment and let's say that we want to install the popular libraries that a typical data science project would require so let's start with matplotlib you could type in conda install because you want to install it and then matplotlib it will ask you that do you want to proceed because it will install all of these dependencies library type in y enter so you can see here now that the dependencies will be installing so this should take quite a while all right and now it's finished now let's continue with another one honda install cycle learn sk learn oh it's actually conda install scikit learn and why enter because when you're using the library you're referring it to the sk learn but then when you want to install it it's scikit scikit-learn let's go with seaborne and another one would have to be pandas but you can see here that it is installing pandas as a prerequisite here so panda is already installed and let's check again condo list and now we have pandas already we have sci pi we have seaborne we have psychic learn we have sequel lights we have numpy right here and let's do streamlight honda install streamlit but actually for streamlight you could install it using pip so a point you notice that when you're in a content environment you could definitely install libraries using pip as well so let's do that pip install streamlit so wait a moment all right and now it's finished let's see what other functions that we would use so using pip in the environment i have shown you that already viewing a list of your environments let's see okay so that would come in handy so conda env list will allow you to see the names of all of the content environments on this particular computer so the asterisk here will be the one that i'm currently in which is test01 and this is the path to the test01 where it is residing on my computer and so let's see what else would be another common way to use it okay so here let's say that i'm finished using the conda environment but then before that let me show you because now we're already in this particular environment but then it is still a bash right you're in the command line still and so in order to go into python you would type in python and now you're in the python inside the contact environment and now you could import you know you could play around with your code as usual okay import libraries and then you could do stuff in python all right you could import pandas as pd right and then let's say that we're finished using python and then we will want to exit it using the exit function and let's say that i want to deactivate this particular condyle environment what do i do well i just type in conda the activate and it hit on enter and that's it and then notice that i'm now back into the base version of the conda and then if i want to activate another conda environment i could do that i'll just type in for example conda activate and then the name of the conda environment which on my computer i have several so now i'm activating the data professor conda environment and then as you can see here i'm now in the data professor conda environment and i could do stuff in python and then i could exit it and then i could conduct the environment right and another one that would come in handy is you could share your environment with your coworkers or your friends so you would type in this honda env export and then the environment.yml but in order to export this the first step is to activate the environment to export let's follow this so if you're on a windows you would type in this activate and then my env is the name of the content environment but in mac or linux you would type in source activate and my env so let's do that okay let me go to the desktop and then i'll which is the folder that i want to export the environment.yml and then i'll type in panda enb exports and then greater than symbol and then the name of the file environment.yml now s and then this here environment.yml let's have a look at the contents of it and so it's all of the python libraries and the particular version of it as well and so if you want to create an environment right here for details on creating an environment from this environment.yml see this one okay let's click on it okay right here conda e and v creates dash f and then environment.yml so the first line of the yml sets the new environment's name let's have a look at the first line the first line the name is right here test01 because it is already in our computer let's see what happens but then if it is on a new computer it will create the same name as your current content environment so let me try that conda env create dash f and environment dot one ml okay so it says that there's an error because it is already in existence so let me go to bi and then hit on i so i could edit this in the text mode let's call it test02 escape colon wq to write and quit so the vi is kind of like a text editor in the command line and now let's run it again i'll hit on the up arrow which will repeat the acquire commands hit on enter and now it's going to install the environment from the environment.yml file and you can even also clone your environment without even exporting out and then reinstalling it from the yml file you can just clone it okay and if you want to clone your environment so you would type in conda create and then dash dash name and then the name of the new clone and then dash dash clone and then the name of the original environment okay and now it is finished and you could activate the clone let's do that let's deactivate the original one and now activate the clone test02 and now here let's do it python i'm in the python of the clone and then exit and then click on the list to see the list of the libraries again and there you go all of the libraries are in here so congratulations you're now able to use miniconda to install libraries for your data science project or your coding projects and so if you're finding value in this video please support the channel by smashing the like button subscribing if you haven't already and also make sure to hit on the notification bell so that you will be notified of the next video and until next time happy coding
Info
Channel: Coding Professor
Views: 3,826
Rating: undefined out of 5
Keywords: conda, anaconda, miniconda, mini conda, mini-conda, how to get started with conda, conda tutorial, python conda, conda python, conda create environment, conda install, pip install, conda manage environment, python manage environment, python environment, conda python library, conda python libraries, python library management, python libraries management, how to use conda, how to install conda, how to share python environment, conda share environment, conda list
Id: sDCtY9Z1bqE
Channel Id: undefined
Length: 10min 56sec (656 seconds)
Published: Sat May 01 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.