0

My python is not recognized as the name of a cmdlet, when I uninstall the old version (3.9) to the new version (3.10), i have tried to update my path in the environment variable, but it still goes to the previous python (3.9)

here's my path :

Update Path

error occurred

PS D:\CodingFile> & C:/Users/amirc/AppData/Local/Programs/Python/Python39/Scripts/python.exe "d:/CodingFile/Python/Latihan Kuliah/Struktur-Data/amir.py"
& : The term 'C:/Users/amirc/AppData/Local/Programs/Python/Python39/Scripts/python.exe' 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:3
+ & C:/Users/amirc/AppData/Local/Programs/Python/Python39/Scripts/pytho ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:/Users/amirc/...ipts/python.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

the error occurs based on the information it is still on the old version path,can anyone help..

Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
Acayzx
  • 3
  • 1
  • 5
  • Welcome to SO. How exactly are you running the new python version? Is your ```& C:/Users/amirc/.../Scripts/python.exe..``` what you type in or is this some script? – ewokx Mar 28 '22 at 05:18
  • i run it in visual studio code, i have tried in cmd there is no problem, what i run. just prints something and it doesn't run.. – Acayzx Mar 28 '22 at 05:27

2 Answers2

0

If you are using it in vscode you might have to tell it to change its interpreter. See this

Silkyway
  • 64
  • 7
0

mr freddy's answer is correct, but still can't run when I try manual, by opening visual studio code and running the program, more precisely I changed, python select interpreter, (CTRL + P, python: select interpreter) in visual studio code , and set global env, thanks all

Python : interpreter

Acayzx
  • 3
  • 1
  • 5