How to create a virtual environment in Python

To create a virtual environment, we must perform the following steps in this order:

Create a directory where the project will be:

$ mkdir proyecto

  • Enter the directory:

$ cd proyecto

  • Create virtual environment (if you want to give it a special name, change the dot, by the name):

$ python3 -m venv .

  • Activate the created environment:

$ source bin/activate

  • To disable it (always in the same directory):

$ deactivate

😉

Leave a Reply

Your email address will not be published. Required fields are marked *