Python virtual environment is tool that keeps every package in solated from system. This tool is required when you are working on different project on same machine. This will help to install same package with different version for different package.
In this article, we will install and create virtual environment for Python 3. We will use PIP to install the package. So let's start by installing virtual environment.
First open the Terminal and run the below command.
pip3 install virtualenv
or install using apt command for Debian based distribution system.
sudo apt-get install python3-venv
You have installed virtual environment package. Now we need to create virtual environment for every project. For that, go to the project directory in Terminal and run the command.
python3 -m venv new-env
This will create new-env directory with python files. This directory will install all packages when you activate environment. To use this environment, you need to activate it. To activate environment, run the below command.
source new-env/bin/activate
When you run this command, environment name will be prefixed in the new line.
Now all your python package will install and remove package in this environment. Once you done with environment package, you can deactivate the environment with deactivate command.
deactivate
So in this article, we have learned how to install and create Python environment. This way you can create as many environment as you want. Thank you for giving time in reading the article.
Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]
Laravel Eloquent WhereNotIn Method Query Example
Laravel WhereNotIn query method is oppos...Create CRUD Application Example with REST Web API in Angular
In this article, I will share with you h...Laravel 8 Create Events in Fullcalendar using Ajax
In this article,I will show you how you...How To Check and Increase Swap Space in Ubuntu
A computer has limited amount of physica...Laravel 8 Google Recaptcha Tutorial Example
Google Recaptcha is Captcha service by G...