Skip to content

No instructions on activating Windows venv #2

@GToidZ

Description

@GToidZ

### Virtual Environment
It's a good practice to install app dependencies in a virtual environment,
so that the packages don't modify or corrupt the system's Python installation.
(Demo in lab.)
Here's an example of creating a virtual env and installing dependencies.
You can use either `python -m venv` or the `virtualenv` tool (separate package). Virtualenv claims to be faster and better, as explained on
[StackOverflow](https://stackoverflow.com/questions/44091886/whats-the-difference-between-virtualenv-and-m-venv-in-creating-virtual-env).
So, if you already have `virtualenv` on your system, use it.
```
python -m venv env # create the virtual env in "env/", only 1 time
. env/bin/activate # start the virtual env in bash or zsh
pip install -r requirements.txt
```

Windows has different structure for venv, I suggest adding another code block for Windows users:

py -m venv env
.\env\Scripts\activate
pip install -r requirements.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions