I am trying to create a virtual environment by executing this command: virtualenv venv --python=python3.7 but it returns 'command not found' error
Asked
Active
Viewed 4,388 times
0
-
have you not installed [`virtualenv`](https://docs.python-guide.org/dev/virtualenvs/#lower-level-virtualenv) yet? – chickity china chinese chicken Nov 16 '18 at 01:51
-
https://stackoverflow.com/search?q=%5Bvirtualenv%5D+command+not+found – phd Nov 16 '18 at 11:59
2 Answers
2
Personally, I think virtualenv
is deprecated now that venv
comes with Python 3.7 (https://docs.python.org/3/library/venv.html).
Virtual environments are created like so with venv
(according to the docs):
python3 -m venv /path/to/new/virtual/environment
I don't think venv
is a virtualenv
command (https://virtualenv.pypa.io/en/stable/userguide/#usage; https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments), and at least not for what you are trying to do. The command for new virtual environments with virtualenv
is virtualenv ENV
.

NotAnAmbiTurner
- 2,553
- 2
- 21
- 44
-
1If you're a Mac user then `venv` will also set up Python as a framework. This makes Matplotlib's default renderer work. I've switched to `venv` just for this feature. – Adam Nov 16 '18 at 02:28
0
maybe you should install virtualenv first:
pip install virtualenv
maybe you should check the virtualenvwrapper, which is based on virtualenv and much easier to manage your virtual environment.

Han.Oliver
- 525
- 5
- 8