Aryan Mehta
Aryan Mehta

Reputation: 1

Created a virtual environment 'test' in my windows command prompt, but workon test not working in visual studio code? How to fix?

Error: PS C:\Users\ARYAN\projects\project1> workon test workon : The term 'workon' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again. At line:1 char:1

Upvotes: 0

Views: 1276

Answers (2)

sumit kumar
sumit kumar

Reputation: 25

Try this :- 1.) For Creating Virtualenv

py -m venv project_name

2.) For activating the Project to work on

.\project_name\scripts\activate

Upvotes: 0

sakifa shah
sakifa shah

Reputation: 1

workon didn't work for me also. So, I tried another way to activate my virtual environment. Press Ctrl+Shift+P then select Python: Select Interpreter. then choose your environment. If you can't find your environment from the list, you can enter the interpreter paths, for example, "C:\Users\user\venv\Scripts\python.exe"

Finally, reopen VS and voila!

check out their documentation https://code.visualstudio.com/docs/python/environments

Upvotes: 0

Related Questions