-3

What does the -m mean while creating a virtual environment?

For example, py -3 -m venv env.

What does the -m mean? What's the difference of venv and virtualenv?

Thanks.

CKE
  • 1,533
  • 19
  • 18
  • 29
  • 2
    `-m` *in Python* (i.e. the `python` executable) probably means something very different than `-m` in whatever command it is you're executing there. What exactly is `py`? – deceze Jul 20 '18 at 12:23

1 Answers1

4

What does the -m mean?

From python manual page:

-m module-name
Searches sys.path for the named module and runs the corresponding .py file as a script.

py -m venv env will tell Python (the Windows version uses py) to use execute the venv module and create a virtual environment that will be stored in the env directory.

From virtualenv documentation:

Virtualenv has one basic command:

$ virtualenv ENV

Where ENV is a directory to place the new virtual environment.


What's the difference of venv and virtualenv?

venv and virtualenv are just shorter versions of virtual environment, meaning that venv is the same as virtualenv -- there is no difference.

Fanatique
  • 431
  • 3
  • 13