What Jill in my mind will create alternate installations of python using the main installation as a
model.
That is the global installation and then after creating the virtual environment we can switch to the
virtual environment and install a neat package that we may want in here.
And these packages will remain with this specific environment.
So as you can see each watch environment has its own side Packages Folder carrying each one specific
version of the package.
Five in order to use a watch in environment packages or resources in isolation.
We need to activate it and this is the command that we need to type in the command prompt in order to
activate the watch environment so in a newly created virtual environment there will be activate shell
script and these scripts are used to set up our shell to use the environment Python executable.
And it's site packages by default.
So this is a command to activate the the virtual environment source and deep part to the virtual environment
activate scripts in my Windows system.
I have given the pod to the Activate script in the scripts directory in order to activate the virtual
environment.
So let's go ahead and execute and then hit enter.
So after we have activated the watch and Wideman the prompt has now prefixed with the name of our virtual
environment.
As you can see tutorial here is the name of our virtual environment.
And this is the indicator that the watch environment tutorial is currently active and which means the
python executable will only use this environment packages and settings.
So we are in the watch environment tutorial let us install a package in this virtual environment and
the command for installing packages using Pip is p IP install one to install the package your three
key.
So because they were still environment is activator the packages install using Pip are placed in the
watch environment.
Sight packages directory instead of the python's installation side packages directory.
So let's verify the packages installed in the Wachtel and Weidmann side packages directory.
So this is the directory for the watch Alan Weidman and let us go to the folder library and then go
to site packages and here we have the newly installed package in the virtual environment site packages
directory.
Next a virtual environment provides an easier method to keep track of the packages installed in the
project.
So once we have activated the virtual environment it provides defensively to freeze the current state
of the environment packages and this can be achieved by using this command Pip freeze and but to the
virtual environment requirements text file.
So what does this requirement text file
the requirements file will hold the necessary dependencies for your project and this command the PIP
freeze command creates a file called the requirement dot XT which has details about the packages with
the warrants in the current environment and this file the requirement that text file would be really
helpful for deploying the project or not different platform.
Since all the project dependencies are already at your disposal indeed requirements file.
So when you want to distribute up a project to others as it allows other programmers to install all
the required packages with these requirements the text file in order to install the dependencies of
the project.
This is the command used pip install hyphen R and then part to the requirements by so in our system
let's go ahead and create a requirements file.
So this is the command to freeze the packages in a project so the Petraeus command will save the details
about the packages with versions in the current environment in the requirements file.
So let's open this file so here is the requirement file with these packages and the Washington numbers
once we are done working in the virtual environment we can deactivated using the command deactivate
the deactivate script is used to clear the currently active worldwide so let us deactivate the watch
tool environment tutorial and this is the command D activate then hit enter the command prompt has been
changed and deactivating a watch it environment will return us to the global environment.
And this brings us to the end of the topic Pip and what Julian Wideman.