Sorry if I sound a bit foolish. I'm confused about this what's the difference between the two
virtualenv myvenv
and
-m venv myvenv
The first one works well for me in creating virtual environments while the other does not.
I CD into my development directory and use "virtualenv myvenv" and it creates the virtual environment. But if I use "-m venv myvenv" it just gives errors. Please help me understand
These are almost completely interchangeable, the difference being that virtualenv supports older python versions and has a few more minor unique features, while venv is in the standard library.
The venv module provides support for creating lightweight “virtual environments” with their own site directories, optionally isolated from system site directories.
virtualenv is a tool for creating isolated Python environments containing their own copy of python , pip , and their own place to keep libraries installed from PyPI. It's designed to allow you to work on multiple projects with different dependencies at the same time on the same machine.
Virtualenvwrapper is a utility on top of virtualenv that adds a bunch of utilities that allow the environment folders to be created at a single place, instead of spreading around everywhere.
venv is a package shipped directly with python 3. So you don't need to pip install
anything.
virtualenv instead is an independent library available at https://virtualenv.pypa.io/en/stable/ and can be install with pip
.
They solve the same problem and work in a very similar manner.
If you use python3 I suggest to avoid an "extra" dependancy and just stick with venv
Your error is probably because you use Python2/pip2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With