python : How to install venv

python

What is venv?

By creating a virtual environment, it is possible to prevent problems due to version differences and batting with other built environments.

Create venv

python -m venv venv

How to start venv in bash shell / zsh shell

source venv/bin/activate

For most people this is fine

How to start venv in fish shell

source venv/bin/activate.fish

Click here for fish (Search Results Web results)

(venv) ?? @ ??? ~ / web>

(Venv) is displayed at the beginning

end venv

deactivate

Introduction

introduction

venv has a site directory for each virtual environment, which can be separated from the system site directory. Each virtual environment has its own Python binary (matching the version of the binary used to create this virtual environment), and you can install a separate set of Python packages in the site directory for each virtual environment.

Benefits of using venv

Although it is a special case, if you are using an old development environment such as django1 in a company etc. If you are developing using django3 privately, use venv to build an environment where django1 and django3 coexist. Can be done. You can prevent errors by any chance

Recent environment apps are less likely to cause conflict errors unless there is a lot of trouble (I'm not saying that they will not), so there is little advantage in using venv for the trouble.

install python 3

To use venv, you need an environment where python3 is installed.

Check if your os contains python3

At the terminal

python -V

Python 3.X.X

If it is output, python3 is installed in os.

Install python3 arch linux

Launch terminal

pacman -S python

Check if python3 is installed

python3 -V

Python 3.X.X

Building the venv environment

python -m venv venv

A venv folder is created in the current hierarchy of the terminal

How to start venv with bash or zsh shell

source venv/bin/activate

For most people this is fine

How to start venv in fish shell

source venv/bin/activate.fish

Click here for fish (Search Results Web results)

(venv) ?? @ ??? ~ / web>

(Venv) is displayed at the beginning

pip update

With (venv) displayed at the beginning

pip install -U pip

To build the venv development environment, always run pip with (venv) at the beginning.

Remove venv development environment

Delete venv folder

thank you

Thank you for watching until the end. I'm glad if you can use it as a reference.

Thank you for Helping

I'll buy an amazon card and help you

We will continue to update useful information. I am delighted to jump to your help. Thank you very much.