You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: minor versions update instead of install, even if previous versions were uninstalled; this messes up pyenv versioning #401
Describe the bug
Installation of a new patch (e.g. 3.9.x) version of Python results in an update instead of a new installation, which messes up version numbers in pyenv-win and makes it impossible to uninstall.
I believe, the main issue is that recent Python installers are smarter and detect other installed versions, or previously installed versions as pyenv uninstall doesn't seem to do a clean job. This means that pyenv install will offer an update instead of a quiet installation.
Problems:
Pyenv doesn't do clean uninstalls of previous versions (registry entry left behind?)
Pyenv doesn't seem know how to install minor version in parallel (override update mechanism)
To Reproduce
Steps to reproduce the behavior:
Install Python 3.9.12 pyenv install 3.9.12
(optional) uninstall same pyenv uninstall 3.9.12
install new minor version pyenv install 3.9.13
Problem: Python installer UI appears and asks if it should update previous installation, even though it's already uninstalled. Proceed, and Python is installed into the previous version's folder (in this case 3.9.12 under pyenv versions). python command correctly launches 3.9.13, but pyenv version(s) will show 3.9.12 as installed. Trying to uninstall 3.9.13 or 3.9.12 fails because pyenv is mistaken about the version, and consequent re-installs still just install 3.9.13 again into 3.9.12's folder. pyenv global 3.9.13 also fails as pyenv thinks 3.9.12 is installed.
Another example:
pyenv install 3.9.13
pyenv uninstall 3.9.13
Run pyenv install 3.9.13 again OR python installer python-3.9.13-amd64.exe. The UI will pop up, offering to modify, repair or uninstall the existing installation. This shows that pyenv uninstall doens't do a clean job. However, choosing uninstall in the UI will result in an error saying no installation detected.
This situation can be corrected by installing through pyenv install, then uninstalling with the installer .exe file.
Expected behavior
I expect pyenv to correctly uninstall previous versions, so that new versions don't try to upgrade (especially not in the wrong folder!)
I expect pyenv to be able to install 2 minor versions at the same time (block update, install separately)
I expect pyenv not to be mistaken about the versions installed
Python versions have a relevant entry under Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall that are left behind even after pyenv uninstall. After removing the entry for 3.9.12, 3.9.13 didn't offer an update anymore. The python installer .exe also removes the registry entry after an uninstall.
Regarding how to override the update mechanism to create parallel minor version installs, maybe hiding the presence of other versions by removing the same relevant registry entries would do the trick? This might be OK if uninstallation can work without the registry entry.
Desktop (please complete the following information):
changed the title [-]bug:[/-][+]bug: minor versions update instead of install, even if previous versions were uninstalled; this messes up pyenv versioning[/+]on Jun 23, 2022
Do I understand the code correctly that pyenv uninstall merely deletes the installation folder? If so, it's no wonder that the installer detects previously present installations of the same minor version. It might be better to invoke the installer .exe with the /uninstall flag - that removes the folder and cleans up other traces.
I haven't been able to figure out a way for parallel installs of patch versions (e.g. 3.9.12 and 3.9.13). The installer always detects that another version is present (e.g. installing 3.9.12 after 3.9.13 fails due to a newer version being already installed). I've tried deleting relevant registry keys at following places, with no success:
Also had a quick peek at a process monitor trace showing registry and file accesses of python-3.9.12-amd64.exe, but nothing popped out as a possible target.
I found the same issue when I installed 3.10.4, when I wanted to install 3.10.5, it automatically installed to the folder 3.10.4. So the python version is 3.10.5 and the pyenv version is still 3.10.4. When I manually uninstall 3.10.5 and 3.10.4 both. I installed 3.10.5 and wanted to parallel install 3.10.4 but it failed. The installer detects a new version has been installed. Don't know where the installer finds the new version info.
It is fixed on the master branch. (see #410) If you want to clean up your PC you should uninstall via WIndow's "Add or remove Programs" system settings page and pyenv uninstall after that. re-installing should now work as you were used to.
Activity
[-]bug:[/-][+]bug: minor versions update instead of install, even if previous versions were uninstalled; this messes up pyenv versioning[/+]zEdS15B3GCwq commentedon Jun 23, 2022
Do I understand the code correctly that
pyenv uninstallmerely deletes the installation folder? If so, it's no wonder that the installer detects previously present installations of the same minor version. It might be better to invoke the installer .exe with the/uninstallflag - that removes the folder and cleans up other traces.I haven't been able to figure out a way for parallel installs of patch versions (e.g. 3.9.12 and 3.9.13). The installer always detects that another version is present (e.g. installing 3.9.12 after 3.9.13 fails due to a newer version being already installed). I've tried deleting relevant registry keys at following places, with no success:
Also had a quick peek at a process monitor trace showing registry and file accesses of
python-3.9.12-amd64.exe, but nothing popped out as a possible target.TakiGuan commentedon Jul 16, 2022
I found the same issue when I installed 3.10.4, when I wanted to install 3.10.5, it automatically installed to the folder 3.10.4. So the python version is 3.10.5 and the pyenv version is still 3.10.4. When I manually uninstall 3.10.5 and 3.10.4 both. I installed 3.10.5 and wanted to parallel install 3.10.4 but it failed. The installer detects a new version has been installed. Don't know where the installer finds the new version info.
Darsstar commentedon Jul 19, 2022
It is fixed on the master branch. (see #410) If you want to clean up your PC you should uninstall via WIndow's "Add or remove Programs" system settings page and pyenv uninstall after that. re-installing should now work as you were used to.