2

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
4
  • If you use --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 install 3.8.10 which means you have to know it exists.
    – Ramhound
    Commented Mar 15, 2022 at 15:10
  • @Ramhound --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.
    – watery
    Commented Mar 16, 2022 at 8:34
  • It’s only a test, you can easily restore the configuration, after you get the results. I am not going to look at anything until you provide those results
    – Ramhound
    Commented Mar 16, 2022 at 11:43
  • @Ramhound Just did it today, as I needed 3.7 after having worked with 3.10 on another script; --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 run choco find temurin -a you'll see different packages for the different Java majors (8, 11, 16, etc.)
    – watery
    Commented Aug 2, 2022 at 12:15

1 Answer 1

1

I had similar conundrum after I used choco to install 3.9.0. Shortly after doing it I realised there is actually 3.9.12 available and I couldn't workout how to update/upgrade with choco without jumping to 3.10.4 as it threatened to do after running:

choco upgrade python --what-if

so I did this instead:

choco install python --version=3.9.12

and it looks fine so far...

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .