I need Python 3.8 on my box and decided to install it with Chocolatey.
I see there are a lot of them:
> choco list python3 -e --all
Chocolatey v0.12.1
python3 3.10.2 [Approved]
python3 3.10.1 [Approved]
python3 3.10.0 [Approved]
python3 3.9.10 [Approved]
[...]
python 3.9.0 [Approved]
python 3.8.10 [Approved]
python 3.8.9 [Approved]
python 3.8.8 [Approved]
[...]
For the sake of testing I went with 3.8.9, to see whether I could upgrade after that:
> choco install python -e --version 3.8.9
The installation went smooth and completed as expected. Now I want the latest 3.8 which is 3.8.10, but:
> choco upgrade python --noop
says it would install 3.10.2:
Chocolatey v0.12.1
_ Chocolatey:ChocolateyUpgradeCommand - Noop Mode _
You have python v3.8.9 installed. Version 3.10.2 is available based on your source(s).
Chocolatey can upgrade 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Did you know the proceeds of Pro (and some proceeds from other
licensed editions) go into bettering the community infrastructure?
Your support ensures an active community, keeps Chocolatey tip-top,
plus it nets you some awesome features!
https://chocolatey.org/compare
and I couldn't manage to find how to express "the latest 3.8":
> choco upgrade python --noop --version 3.8
Chocolatey v0.12.1
_ Chocolatey:ChocolateyUpgradeCommand - Noop Mode _
A newer version of python (v3.8.9) is already installed.
Use --allow-downgrade or --force to attempt to upgrade to older versions, or use side by side to allow multiple versions.
Chocolatey can upgrade 0/1 packages. 1 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Failures
- python - A newer version of python (v3.8.9) is already installed.
Use --allow-downgrade or --force to attempt to upgrade to older versions, or use side by side to allow multiple versions.
or
> choco upgrade python --noop --version 3.8.x
Chocolatey v0.12.1
_ Chocolatey:ChocolateyUpgradeCommand - Noop Mode _
'3.8.x' is not a valid version string.
Nome parametro: version
--allow-downgrade
or--force
with 3.8.9 what version exactly is installed? I would imagine you are trying to perform a corner case operation, which means, you will need to specifically indicate you want to install3.8.10
which means you have to know it exists.--force
is not recommended by per the docs, and I'm looking for a supported solution;--allow-downgrade
seems to allow installing a previous version, which is otherwise blocked, but I'm looking for the next. Since Python 3.x may not be totally compatible with 3.(x+1) (you may check this and this), I wanted to see whether choco is able to upgrade fixing some version scheme.--allow-downgrade
allowed installing the previous version, otherwise I had been stopped with an error that a newer version is already installed. After your comment, however, I had to install Java: I guess this is a matter of how Python has been packaged in choco, because if you runchoco find temurin -a
you'll see different packages for the different Java majors (8, 11, 16, etc.)