Aditya Rampurkar
Aditya Rampurkar

Reputation: 11

'virtualenv' is not recognized after pip install

CMD does not recognize the virtualenv command after pip install, as shown below:

Microsoft Windows [Version 10.0.22509.1000]
(c) Microsoft Corporation. All rights reserved.

C:\WINDOWS\System32>cd C:\Users\adity\OneDrive\Desktop\GFG

C:\Users\adity\OneDrive\Desktop\GFG>pip install virtualenv
Requirement already satisfied: virtualenv in c:\users\adity\appdata\roaming\python\python310\site-packages (20.13.0)
Requirement already satisfied: six<2,>=1.9.0 in c:\users\adity\appdata\roaming\python\python310\site-packages (from virtualenv) (1.16.0)
Requirement already satisfied: distlib<1,>=0.3.1 in c:\users\adity\appdata\roaming\python\python310\site-packages (from virtualenv) (0.3.4)
Requirement already satisfied: filelock<4,>=3.2 in c:\users\adity\appdata\roaming\python\python310\site-packages (from virtualenv) (3.4.2)
Requirement already satisfied: platformdirs<3,>=2 in c:\users\adity\appdata\roaming\python\python310\site-packages (from virtualenv) (2.4.1)

C:\Users\adity\OneDrive\Desktop\GFG>virtualenv venv
'virtualenv' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\adity\OneDrive\Desktop\GFG>

Upvotes: 1

Views: 6187

Answers (1)

W. Mayo
W. Mayo

Reputation: 43

  1. If Scripts is already in path variable then check if you have virtualenv.exe in that folder is it is not thee then remove virtualenv and add it again. Just like @saeed-emamyari suggested.
pip uninstall virtualenv 
pip install virtualenv
  1. virtualenv.exe is in pyhton scripts folder and this folder must be in your PATH environment variable. Add the python script folder path to your path variable. Location should be C:\Users\adity\AppData\Local\Programs\Python\Python38\Scripts. You need to open a new cmd to test because environment variable do not get reload after cmd is opened. (No idea why microsoft won't just make an event listener/handler for this)

Upvotes: 3

Related Questions