cmd shows Older version of Python, and IDLE shows the current version

232 Views Asked by At

Here in cmd show this older version enter image description here

but, IDLE shows this version (which i again installed) enter image description here

because of this VsCode uses older verison of Python instead of Current version enter image description here

i tried setting path, but it still shows the older verison of python, uninstalled and installed it too.

in setting, Current version of is interpreter selected ,then also it runs program on older version enter image description here

if by mistake there is two version of python, how do i get rid of older version of Python

i just want to use newer version of python

Edit:

it works, when i "Run Python File",(on current version), Any way to set this as default?

but, when i "Run Code" (ctrl + shift + N), it opens new terminal and runs that code in older version of python

i didn't installed two versions ,it was just as possibility .

but, there was python 10.12 present in Bin folder of MSYS2 . i don't have any idea, of that python in bin folder

2

There are 2 best solutions below

1
Blue Bon On BEST ANSWER

i found the answer, thanks to Mr. Terry Jan Reedy there was python older version (see image)

i just deleted these python files and now Vscode runs program on Newer version of Python

2
MingJie-MSFT On

If you have chosen the Python3.11 as VSCode Python Interpreter, you can use shortcuts Ctrl+Shift+` or VSCode command Terminal: Create New Terminal to open a new terminal. Another way is delete the current terminal, and click the button "Run Python File" to run any python file.

enter image description here

Vscode will automatically activate the one you have selected.

If you're using code-runner extension, you can add the following codes to your settings.json to set the default interpreter:

"code-runner.executorMap": {
    "python": "python"
}