Latest posts

10/recent/ticker-posts

Creation of an Virtual Envionment in Pyhton

Creating an Virual Environment In Pyhton

Understanding Virtual Environment First ?

Virtual environment creates a virtual space in your computer system, where you can seprate your dependencies equired by different projects in Python.
It is a tool helps to keep dependencies required by different projects separates by creating isolate python viertual environment for them. This ia one of the most important tools that most Python developers use.

Install Virtual Environment in System :

We need to install b=virtual environment package first by uding this Command.


    pip install virtualenv


Create a Virtual Environment :

We have successfully install virtualenv package, noe let's create a virtual environment.


    virtualenv env


here, env is the name of our Virtual Environment.
You can able to set any another name for your virtual environment like,


    virtualenv code_makes_rohan


Activate the Virtual Environment :

We have created a Virtual Envirionment Successfully, now we need to Activate our Virtual Environment.

To activate the Virtual Environent, just hit this command.


    source env/bin/activate


You can use your Virtual Environment's name instead of env .

For Linux : 


    source env/bin/activate


For Windows :


    env\Script\activate


Here env is the name of our Virtual Environment.
You can use your Virtual Environment's name instead of env .

Ex,


    code_makes_rohan\Script\activate


Virtual Environment gets activated Successfully. 
Now here you can install all your required packages for different python projetcs, and it is going to be install in you virtual environment, instead of your system.

Deactivate the Virtual Environment :

To deactivate you virtual environment, just hit this command,


    deactivate


and see, your virtual environment gets, deactivated...!

Now if you install any package of python, it's gets installed in your system, because we are deactivated our virtual environment.

Did you find this Helpful ? Answer in Comments.....!


Thanks for Visit...!
Stay Aware, Stay Safe..!




Also Visit


Post a Comment

0 Comments