A Virtual Environment is a python environment, that is an isolated working copy of Python which allows you to work on a specific project without affecting other projects So basically it is a tool that enables multiple side-by-side installations of Python, one for each project.
- Use below command if pip is not in your system
$ sudo apt-get install python-pip
- Then install virtualenv
$ pip install virtualenv
- Now check your installation
$ virtualenv --version
- Create a virtual environment now: In your local folder named virtualenv_name will be created. You can name anything to it.
- Now at last we just need to activate it, using command
$ source virtualenv_name/bin/activate
- Now you are in a Python virtual environment and You can deactivate using below command
Leave a comment