0

I use VSCode and I have just updated Python from 3.9.1 to 3.9.5, but it won't show on the status bar, that blue bar at the bottom where, at the left of it, it shows the Python interpreter.

This is what I get when I open Python, regardless of where: cmd, VSCode terminal, from the file in the Python39 folder...

Python 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] 
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

Undoubtedly, the current Python version in my machine now (Windows 10) is 3.9.5. Python path is correct, by the way.

"python.pythonPath": "C:/Users/[myUserName]/AppData/Local/Programs/Python/Python39/python.exe",

At the "Python: Select Interpreter" box I have two options: one is an outdated conda interpreter (version 3.8.5) which I never use, and the other one is this path that points at the updated version, but only shows as "version 3.9.1".

VSCode "sees" 3.9.5 but shows as 3.9.1. Here is a screenshot: Versions don't relate

So, is there a way to change it? Is it no supposed to change?

UPDATE:
I have set up a virtual environment in the workspace of the screenshot. Just did it, activated, deactivated, then restarted VSCode.
I have no idea why, but now Python 3.9.5 shows in the interpreter list, with its path pointing at the virtual environment's folder "Script". So apparently, creating a virtual environment to a workspace sets up its own interpreter.
Still, I wish I could make it default, not having to create a virtual environment everytime.

101is5
  • 309
  • 2
  • 12
  • click on the lower left Python and see which interpreters you can choose, have you restarted VSC after the Python install – rioV8 Jun 07 '21 at 19:45
  • Thanks. Yes, I have restarted VSC a couple times. As i said, when clicking on the interpreter, I have here two options: a conda interpreter (never used), and the one I always use, whose path leads now to the updated version of Python. Although it leads to the version I've just updated to, 3.9.5, VSCode shows it as 3.9.1. I also have restarted Windows a couple times. – 101is5 Jun 07 '21 at 19:56
  • [SOLVED]. Turns out it was a bug. I mean, it had to be: VSCode was reading the version 3.9.5 of python.exe but displaying-and actually running- 3.9.1. Any possible explanation for it will be immensely appreciated. So, a complete uninstall of VSCode did solve the problem: 1) Run unistaller("unins000"); 2) Win + R, type "%appdata", delete "Code" folder (source: https://stackoverflow.com/questions/47689536/uninstall-visual-studio-code-in-windows). Now, finally, VSCode reads the updated Python interpreter as expected. – 101is5 Jun 07 '21 at 22:39

0 Answers0