5

I am using advanced Python as well as Pycharm (Up to date as of 2017) when I am using pip/virtual env install.

I got this error:

'virtualenv' is not recognized as an internal or external command, operable program or batch file.

Could advise a solution for this?

Thanks.

Moshe Slavin
  • 5,127
  • 5
  • 23
  • 38
Vamsi Chowdary
  • 49
  • 1
  • 1
  • 2

7 Answers7

4

You need to install virtualenv using pip (pip installs packages)

Open command prompt and type:

pip install virtualenv. 

Good luck.

Vivek Molkar
  • 3,910
  • 1
  • 34
  • 46
Laurence Maskell
  • 611
  • 1
  • 5
  • 6
3

I had a similar problem using Python 3.7.3 on Windows 10 - 64 Bit and in my case it turned out that I had installed the incorrect version of the virtualenvwrapper. I had used the command

pip install virtualenvwrapper

which installed successfully but If you're on Windows you need to make sure you run this command

pip install virtualenvwrapper-win

with the "-win" at the end.

I had to reinstall it and after that my command mkvirtualenv project_name worked fine.

Hope this is useful to someone else out there.

Enomatix24
  • 156
  • 1
  • 7
3

This worked for me. I am also using Python 3.7.3 and used pip install virtualenv first. With this I did not have mkvirtualenv or workon in the Python Scripts folder. Once I ran the pip install virtualwrapper-win both bat files were added to my 3.7.3 scripts folder.

  • That works when done right. My bat files ended up in local working directory the first time I tried it :-( – DLyons Jul 19 '20 at 17:51
3

Commands:-

md MLTestProject
cd MLTestProject
python -m pip install --upgrade pip
python -m pip install virtualenvwrapper-win
python -m virtualenv testenv
Curious Watcher
  • 580
  • 6
  • 12
1

This can also happen if virtualenv scripts are not copied to Python installation directory properly when installing virtualenv on Windows

Run CMD as administrator and then enter

pip uninstall virtualenv

then re-run CMD as administrator and run

pip install virtualenv
Nishan
  • 3,644
  • 1
  • 32
  • 41
0

The following worked well for me:

  1. pip install virtualenv
  2. pip install virtualwrapper-win
  3. mkvirtualenv project_name
Simas Joneliunas
  • 2,890
  • 20
  • 28
  • 35
0

Python 3.6 . 'virtualenv' is not recognized as an internal or external command, operable program or batch file

  • create a virtual environment and activate

    pip install virtualenv

virtualenv name_of_project

or

py -3 -m venv name_of_project
Vivek p.s
  • 1
  • 3