Following error i am getting when try to create Virtual environment in VS Code
PS C:UsersdellDocumentsProgramming> python -m venv C:UsersdellDocumentsProgrammingvenv
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
python -m venv C:UsersdellDocumentsProgrammingvenv
CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundExceptionPS C:UsersdellDocumentsProgramming> python3 -m venv C:UsersdellDocumentsProgrammingvenv
e App Execution Aliases.
PS C:UsersdellDocumentsProgramming> python3 -m venv C:UsersdellDocumentsProgrammingvenv
python3 : The term ‘python3’ 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
python3 -m venv C:UsersdellDocumentsProgrammingvenv
CategoryInfo : ObjectNotFound: (python3:String) [], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundExceptionPS C:UsersdellDocumentsProgramming> python3 -m venv C:UsersdellDocumentsProgrammingvenv
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Managge App Execution Aliases.
I have turned off python & python 3 on App Execution Aliases as well but it doesnt work
2
Answers
Sorry this isn’t an answer but does python work in other env’s (sublime text, python IDLE etc). Also if it doesn’t try running the commands in admin mode in powershell or use the built in vs code terminal.
Judging by the error message, there may be an error with your command, which requires more information to solve the problem.
Another option is to create a virtual environment using the command palette.
Ctrl+Shift+P –> Python: Create Environment
Then choose according to your needs.
https://code.visualstudio.com/docs/python/environments#_using-the-create-environment-command