Skip to main content

One post tagged with "venv"

View All Tags

· One min read
Lejen
  1. Let’s start by installing the python3-venv package that provides the venv module.

    sudo apt install python3-venv
  2. Once the module is installed we are ready to create virtual environments for Python 3.

  3. Switch to the directory where you would like to store your Python 3 virtual environments.

    cd /path/to/your/project
  4. Within the directory run the following command to create your new virtual environment.

    python3 -m venv venv
  5. The command above creates a directory called venv, which contains a copy of the Python binary, the Pip package manager, the standard Python library and other supporting files.

  6. To start using this virtual environment, you need to activate it by running the activate script.

    source venv/bin/activate
    source venv/bin/activate