Question

[Solved] ‘virtualenv’ is not recognized as an internal or external command, operable program or batch file

After I installed Python and Djangom, I’m trying to use virtualenv for django project purpose using virtualenv. I installed virtualenv using pip.

pip install virtualenv # got install successfully

When I tried to run it, I got the error message

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

Solution #1:

steps:
– go to where you want create django app on that folder.

then run this command on command prompt : python -m virtualenv .

(eg. C:UsersgshivDesktopdjango>python -m virtualenv .)

where django is the my folder i want run virtualenv and .(dot) indicates virtualenv install all it’s folder in django folder otherwise you can use other folder name instead .(dot) this time virtulenv creates a folder in main folder(django) .

  • after running this command: run .scriptsactivate now you can see this type of line on cmd-prompt (django) C:UsersgshivDesktopdjango>
  • i.e main folder name before the source path. now you can install any modules for your project that belongs to that main folder only.

pip install django works fine.

Respondent: ShivaGuntuku

Solution #2:

There are three points that you need to consider:

  • Make sure that in the windows PATH variable there is an entry with your python installation and the scripts subfolder eg: C:Program Files (x86)Python36-32 and C:Program Files (x86)Python36-32Scripts
  • When using pip install virtualenv, make sure that you run cmd as administrator. Otherwise, there might an access denied error during installation and virtualenv will not be installed properly.
  • Make sure that virtualenv has been installed correctly. Check in the python scripts subfolder – there must exist an .exe named virtualenv.exe. If not, uninstall will pip uninstall virtualenv and install again.
Respondent: Charidimos

Solution #3:

Run pip uninstall virtualenv and then pip install virtualenv

Respondent: Sergey K.

Solution #4:

When I ran the pip install virtualenv command I got:

Requirement already satisfied: virtualenv in c:directorytoappdataroamingpythonpython36site-packages

so I tried forcing upgrade:

pip install --upgrade --force virtualenv
Respondent: hestellezg

Solution #5:

py -3 -m venv venv

try using the above command.

virtualenv venv

will work on only older version of python

Respondent: praveen kumar

Solution #6:

If you can not find your ‘virtualenv’ command in the windows console after installing it with pip try this to make your environment:

python -m virtualenv <nameOfEnv>

If you need to use a specific version of python, initialize it like this:

python -m virtualenv <nameOfEnv> -p=<C:/path/to/python/version3.x.x/python.exe>

When using windows for first installation, you can use python from WindowsApp

Respondent: Tirbo06

Solution #7:

To install to a specific folder e.g E:publish

pip install virtualenv

virtualenv .

Respondent: MANOJ G

Solution #8:

For windows
First, install -> pip install virtualenvwrapper-win
Then setup -> mkvirtualenv myproject
Then you see the list of virtual environment
To see it you write-> lsvirtualenv
For working this environment we write -> workon myproject

Respondent: Shahadat Hossain

Solution #9:

Run CMD as administrator and then enter

pip uninstall virtualenv

then re-run CMD as administrator and run

pip install virtualenv
Respondent: Firenze

Solution #10:

This almost works for all

  1. Open Command Prompt, navigate it to the Envs folder, run "env_nameScriptsactivate"
  2. Check whether virtualenv is installed or not, if not install it:
    • pip install virtualenv
    • pip install virtualenvwrapper-win
  3. Game On. Check on your IDE.
Respondent: Ram Potabatti

Solution #11:

Try executing virtualenv.exe from its absolute path, like in my case i found it in C:Users<your user>AppDataRoamingPythonPython37Scriptsvirtualenv.exe.

I tried this and it worked, here refer the logs as follows:

Using base prefix c:\users\<user>\appdata\local\programs\python\python37-32
New python executable in C:somedirdir2dir3ML_1mlenvScriptspython.exe
Installing setuptools, pip, wheel…
done.

Respondent: Vishal Garg

Solution #12:

Make sure that virtualenv has been installed correctly. Check in the python scripts subfolder – there must exist an .exe named virtualenv.exe. If not, uninstall will pip uninstall virtualenv and install again.

Respondent: sri_nandhan

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Most Popular

To Top
India and Pakistan’s steroid-soaked rhetoric over Kashmir will come back to haunt them both clenbuterol australia bossier man pleads guilty for leadership role in anabolic steriod distribution conspiracy