Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use update-alternatives to manage additional Python versions #1172

Open
osechet opened this issue Nov 4, 2024 · 0 comments
Open

Use update-alternatives to manage additional Python versions #1172

osechet opened this issue Nov 4, 2024 · 0 comments

Comments

@osechet
Copy link

osechet commented Nov 4, 2024

Hello,
When using the additionalVersions parameter of the python feature, would it be possible to register all the installed versions with update-alternatives?
It would make it easier to switch from one version to another one.
Alternative creation:

update-alternatives --install /usr/local/bin/python3 python3 /usr/local/python/3.12.7/bin/python3 1000 \
            --slave /usr/local/bin/pip3 pip3 /usr/local/python/3.12.7/bin/pip3

Alternative selection:

update-alternatives --set python3 /usr/local/python/3.12.7/bin/python3

Ideally, it would be even better if the installation path was limited to 3.x or if a symlink 3.x was pointing to the corresponding version:

3.10 -> 3.10.15
3.10.15
3.11 -> 3.11.10
3.11.10
3.12 -> 3.12.7
3.12.7
current -> 3.12.7

This way, the user doesn't have to know which specific version has been installed, only needs to know which main version they wants:

update-alternatives --set python3 /usr/local/python/3.12/bin/python3

or if alternatives are not installed:

rm /usr/local/python/current
ln -s 3.12 /usr/local/python/current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant