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

  • workon test
  •   + CategoryInfo          : ObjectNotFound: (workon:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
2

There are 2 best solutions below

0
sakifa shah On

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

0
sumit kumar On

Try this :- 1.) For Creating Virtualenv

py -m venv project_name

2.) For activating the Project to work on

.\project_name\scripts\activate