简体   繁体   中英

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM