microsoft / PTVS

Python Tools for Visual Studio
https://aka.ms/PTVS
Apache License 2.0
2.52k stars 673 forks source link

Bogus Environment Names in UI #7843

Open traits opened 4 months ago

traits commented 4 months ago

I'm using WinPython and have two Python versions 'installed'. One of them can be registered at the same time and when I do this, a strange new bogus environment appears in Visual Studios "Python Environments" UI (cf. screenshots). The references in these environments are correct, but the name "3.1" is wrong. These envs or their UI representation are quite sticky and cannot be removed easily. Additionally, the "3.1" seems to trigger real warnings regarding an outdated Python version. So, it also seems to be interpreted content-wise.

I think, I saw this error in earlier VS versions and it had nothing to do with WinPython, but with the directory naming of the Python installations. From registry:

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.10\InstallPath]
@="V:\\bin\\scripting\\python\\3.10.5\\python-3.10.5.amd64"

resp.

[HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\3.12\InstallPath]
@="V:\\bin\\scripting\\python\\3.12.2\\python-3.12.2.amd64"

Something inside PTVS seems to stumble over the parts containing dots, probably the first one in the respective entry (it can be fixed if this first 3.1x.x part of the corresponding directories is renamed to something else). This might be related to #7812

VS Version: 17.9.2 PTVS version: 17.0.24002.3

The drive V is a permanent subst to some directory G:\programming, in case this matters.

_real_env _bogus310 _bogus312
traits commented 4 months ago

It seems to be a bug in winpython after all. So, this can be closed

traits commented 4 months ago

I will reopen this. Something is still wrong with Python Version Handling. In the PTVS UI an outdated Python Version is assumed also for a default installation made from the standard installer from python.org (see attachements). Interestingly this is not happening for a 3.11.8 installer. I didn't pinpoint the exact version, but 3.12.1 is triggering the error in any case as well as it my WinPython 3.12.2 (again, not the 3.10.5) does. Updating pip to v24.0 doesn't change anything.

Clipboard01 Clipboard02