How to create, activate, and deactivate python virtual environment(virtualenv) on windows

How to create, activate, and deactivate python virtual environment(virtualenv) on windows


How to create, activate, and deactivate python virtual environment(virtualenv) on windows

This video is all about creating, activating, and deactivating python virtualenv on windows platform.
Related Article:
https://www.devzoneoriginal.com/2020/

If this video helped you in any way, please subscribe and hit the bell icon to get notified when I post related content in the future.

Support Me Here - https://www.buymeacoffee.com/agautam
DevZoneOriginal Blog - https://www.devzoneoriginal.com/


Content

2.56 -> hello friends in this video we are going to  talk about virtual environments in python  
8 -> and how to implement those virtual environments  in windows operating system or windows environment  
14.64 -> so here i have opened my command prompt  
19.36 -> and on desktop i have a folder called uh let us  make a new folder mkdir a new folder let's name it  
29.52 -> um a and k you are anchor okay so i have  a new folder let's go inside that folder
40.16 -> now in suppose anchor folder contains a  a python project and you need to create  
47.36 -> a virtual environment for that project so in  order to keep things organized you create a  
53.92 -> new folder here mkdir envs which will create  your environments so let's go to in envs  
65.36 -> and create a virtual environment here in order  to create virtual environment you need to type  
71.2 -> virtual env space your environment name suppose  your environment name is env1 hit enter and now  
84.24 -> your in virtual environment will be created uh  virtual environment is you usually use to avoid uh  
96.08 -> this version mismatch different projects  in python use different dependencies  
104.08 -> and different versions of those dependencies so  if we install those dependencies globally then  
111.44 -> the version versioning will not match with every  project so for every project we create a virtual  
117.52 -> environment and install those dependencies  in them separately so here my environment  
124 -> has been created as it says so we are inside envs  folder let us see the contents of the envs folder
133.92 -> so as you can see
138.72 -> inside env we have our env1 this folder  created env1 very virtual environment created  
148.48 -> so let us go inside this  virtual environment cd env1
155.76 -> i'm doing this just to show you what has  been created uh dir see it includes this  
165.36 -> include directory lib directory license.txt  scripts so let us go inside the scripts
179.44 -> in scripts as you can see here there is a  activate.bat and there is deactivate.bat  
186.4 -> so these the two things we need to take  into account in order to activate and  
191.76 -> deactivate uh our virtual  environment so let us go back
201.92 -> we are inside our envs folder  we have where we have env1  
206.24 -> so here you just type your aenv  variable name which is env1
215.2 -> backslash scripts
218.88 -> backslash activate
224 -> and now as you can see uh env1 is written here  which means nv1 has been activated now whatever  
232.16 -> you will do here paper install uh tensor flow  whatever dependency you will install here it will  
241.12 -> get installed inside env1 and not globally  so as you can see i have done this pip  
248.64 -> installed tensorflow and it's being installed  tensorflow version 2.3.0 is being installed  
254.8 -> into env1 variable only so i'm  just going to cancel it out here
265.52 -> okay it's cancelled still i am inside nv1 unless i  
270.24 -> close this terminal or type  deactivate command so deactivate
278.4 -> now as you can see env1 this name  uh disappeared from this path okay  
285.28 -> so this is how you create and virtual environment  
288.48 -> uh in python in windows platform and activate and  deactivate it so thank you very much hope you like  
295.52 -> this video if you like this video please hit a  like thumbs up and click on subscribe button to  
303.04 -> get similar uh videos in future and you can  also press obviously this notification button  
313.2 -> to get updates of my future future video on  this channel so thank you very much for watching

Source: https://www.youtube.com/watch?v=ebeebaumL3M