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.
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.
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.