Programmers learn & share
+1 vote
560 views

Problem :

Getting bellow python and django error 
'virtualenv' is not recognized as an internal or external command, operable program or batch file.

by (6.9k points)   | 560 views

2 Answers

+1 vote

Solution :

Please follow bellow steps to get rid of the issue
  • The windows PATH variable must have an entry with your python installation and the scripts subfolder as following C:\Program Files (x86)\Python36-32\ & C:\Program Files (x86)\Python36-32\Scripts\
  • While using pip install virtualenv, please make sure that you run cmd as administrator. Or else, there will be an access denied error during installation and virtualenv will not be installed properly.
  • Make sure that virtualenv has been installed correctly. Also check in the python scripts subfolder  there must exist an .exe named virtualenv.exe. If not, uninstall will pip uninstall virtualenv and install again.
by (36.1k points)  
0 votes

Solution:

STEP 1:  You need to setup a virtual environment using

pip install virtualenv # got install successfully

STEP 2:  You create a virtual name

mkvirtualenv test

STEP 3: Get your own environment

uninstall using:

pip uninstall virtualenvwrapper-win
pip uninstall virtualenv

install using:

pip install virtualenvwrapper-win

STEP 4:  Go to where you want create django app on that folder.

After that, run this command on command prompt

python -m virtualenv .
C:\Users\gshiv\Desktop\django>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 .\scripts\activate now you can see this type of line on cmd-prompt (django) C:\Users\gshiv\Desktop\django>

Main folder name before the source path. now you can install any modules for your project that belongs to that main folder only.

ago by (3.7k points)  
2,182 questions
2,453 answers
59 comments
241 users