Manage Python Environments with Anaconda (Windows)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'm going to show you how you can create and manage Python environments with anaconda so he's gonna be the creation and management of virtual Python environments so we're gonna use two different applications to do this we're gonna do it in two different ways we're gonna go to my Windows and I'm gonna search for anaconda I'm going to open my anaconda prompt and then I'm also going to open anaconda navigator oops a navigator here okay and I'm just gonna pause the video while these applications open okay so I have anaconda navigator open I'm not going to update right now I'll just say no to remind me later and I also have anaconda prompt open here so it's actually really easy to create a Python environment using anaconda we're just going to simply type Conda create - - names with the name of our environment and I'm gonna call this CMD to the command line pie and we'll call it police 6 so it's gonna be Python 3.6 and then we need to give it our Python version which will equal 3.6 so once we do that we're going to hit enter and it's gonna take a minute and it's going to go through and it's gonna create our installation it's gonna install these new packages so I'm gonna say yes to install these and it's gonna take them into the download and install everything so I'll pause this while this continues okay so our environment is finished creating you can see that that's done it gives us some hints here we could use Conda activate to activate this environments we've had Conda activate and then the name of the environment and the Sun windows notice if you're doing this on Mac or Linux you'll probably have Conda source activate and then if we want to deactivate an environment we'll use Conda deactivate this is really annoying okay so we're sitting over Miami later on that let's go up and just take a look of some things here that happened after we typed our command so here we take a command to create this environment it says a new version of Conda exists so we can update Conda and it tells us how to do that and then it tells us it's going to download and install these packages which we'd already went through okay so now let's say I want to see what environments I already have that's very easy to do we're simply going to type Conda env or West and when we do that it's going to list all the Python environments and I'll just pause the video while those come up here it is right there so you can see we have our base environment and we have the CMD py 3 6 environment and this asterisk indicates the base is our current environment now if I want to deactivate the environment I'm currently using I can simply type Conda deactivate so let's type that that will deactivate base now you see that base no longer appears next to my command prompt my my current line so now I can type Conda env list and it will show me my environments again this time base will not have a base still has the asterisk it is still that active one was at that one active okay so now let's activate a new environment and if you'll remember we had a hint up here we just type Conda activate the name of the environment can do Conda activate CMD PI 3 6 and hit enter and now I get CMD PI 3 6 right here and if I type Python then you can see that I'm running Python 3.6 point 10 okay and now let's do kondeh env list and see if our asterisk appears next to our current one and you can see that it's switched here so now let's do Conda activate base and switch back to our base environment let's type Python again here and you can see that this one is using Python three point seven point four we should also be able type Python - - version which tells us the version or which python oh that's not gonna work with this command prompt right now but it gives us PI for new python - - version we can get the version of her current prompt over current environment sorry for that okay so now let me show you how you can do this graphically oh one more thing I want to point out when we created this environment let me go back up where we created it I'm sorry because you see where you list it so if we do kondeh env list it will tell you the location of these environments which is important to know so you can see we have this is in the anaconda 3 folder and this is anaconda env s folder and the CM dpy folder so that's the this is the name of the environment okay so let's go back to it let's go over to the navigator now and create one of these graphically so we can come over we can clear click on environments and you can see that it lists all the environments that I already have here so it has base and it has CMD PI 36 and you can see that this tells me this is the active environment ok and we can just go back to our command prompt to confirm this that indeed base is the active environment now we can come down here and click create so let's make a new one and we'll call this MAF because it's a navigator and let's make this three point or three we'll make this three seven now have three seven so you want to do Python we're gonna select a version we're gonna get three point seven and we're going to click create and now it's just gonna put it in my env s folder my environment folder so I want to click create here and it's gonna take a minute to create that and I'm gonna pause this while that finishes wrapping up okay so it created that environment and it made that the active one so let's go back to our prompt and just type Conda env list and you can see that we now have nav 37 on there this keeps asking for an update and I'm gonna say in order my me later again okay and so I'm going to click on this play button here I can open in the terminal I can open it with Python okay and so there you can see that we have these environments now let's say that I created an event by accident I didn't want to have this snap right here I can click on this and I can now click remove and ask if I want to move this environment and yes I do and so it's gonna take a minute here to remove that environment I'm going to pause this while that happens and now you can see on my list I only have CMD py 3 6 I'll go back my prompt and we'll just double check this again so we'll do kondeh env list and when this happens you'll see that nav 37 will no longer be listed there just like that ok so now let's say I want to remove CMD PI 36 using the command prompt I'll show you how to do that now and we simply do that with Conda env remove - - name CMD py 3 6 actually I want to show you one more thing before I do that so let's go first of all to activate that won't through Conda activate CMD py 3 6 okay now let's say I want to just deactivate this environment actually switch to it and I want to go back to my base the way I do that is simply by typing deactivate if you're on Mac or Linux you'll will have to type source deactivate hope so sorry this is depreciated that's gonna be Conda deactivate okay so we'll hit deactivate there and now I don't have anything listed there so let's go Conda env is a list just to show our environments one more time oh yeah Conda env list and let's go ahead and we're going to remove this and so if you remember how we did that we're going to do Conda env sorry we just Conda remove - - name and CMD py Dilys I apologize again this is B con the env we move once we have that we can click hit enter that has removed the environment so let's just do kondeh env list and you can see that we're back to having just our base environment again okay so that is how I need to get rid of this thing that is how you can manage and create anaconda environments for Python I hope you enjoyed this video feel free to check out open source options comm for code and other tutorials and thanks for watching
Info
Channel: Geospatial School
Views: 43,803
Rating: undefined out of 5
Keywords: open source, open source options, python, anaconda, python anaconda, python environment, python environment setup, anaconda environment, anaconda environment setup, conda, conda env, conda remove, conda activate, conda deactivate, python virtual environment, python tutorial, anaconda tutorial for beginners, anaconda tutorial, create python environment, windows, python environment windows
Id: kegL0pBpHsM
Channel Id: undefined
Length: 11min 26sec (686 seconds)
Published: Tue Apr 21 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.