ScoopInstaller / Main

πŸ“¦ The default bucket for Scoop.
https://scoop.sh
The Unlicense
1.58k stars 946 forks source link

[Bug]: Python amd64 with version under 3.11 cannot download the correct URL #4130

Closed JayYoung2021 closed 1 year ago

JayYoung2021 commented 1 year ago

Prerequisites

Package Name

python

Expected/Current Behaviour

My PC is amd64. When I tried to install Python 3.9.12, an error was displayed that "URL https://www.python.org/ftp/python/3.9.12/python-3.9.12-arm64.exe#/setup.exe is not valid". Later I found #4106 added the arm64 support to python. But Python before 3.11 doesn't have support for amd64. Maybe that's why the bug occured.

Steps to Reproduce

PS >scoop install python@3.9.12
WARN  Given version (3.9.12) does not match manifest (3.11.0)
WARN  Attempting to generate manifest for 'python' (3.9.12)
Autoupdating python
Searching hash for python-3.9.12.exe in https://www.python.org/downloads/release/python-3912/
The operation has timed out.
URL https://www.python.org/downloads/release/python-3912/ is not valid
Could not find hash in https://www.python.org/downloads/release/python-3912/
Downloading python-3.9.12.exe to compute hashes!
python-3.9.12.exe (26.7 MB) [=====================================================================================================================] 100%
Computed hash: 3d883326f30ac231c06b33f2a8ea700a185c20bf98d01da118079e9134d5fd20
Searching hash for python-3.9.12-amd64.exe in https://www.python.org/downloads/release/python-3912/
Found: md5:cc816f1323d591087b70df5fc977feae using Extract Mode
Searching hash for python-3.9.12-arm64.exe in https://www.python.org/downloads/release/python-3912/
Could not find hash in https://www.python.org/downloads/release/python-3912/
Downloading python-3.9.12-arm64.exe to compute hashes!
The remote server returned an error: (404) Not Found.
URL https://www.python.org/ftp/python/3.9.12/python-3.9.12-arm64.exe#/setup.exe is not valid
Could not install python@3.9.12
Select-CurrentVersion: C:\Users\Young\scoop\apps\scoop\current\lib\core.ps1:239
Line |
 239 |      return $null -ne (Select-CurrentVersion -AppName $app -Global:$gl …
     |                                                       ~~~~
     | Cannot bind argument to parameter 'AppName' because it is an empty string.
InvalidOperation: C:\Users\Young\scoop\apps\scoop\current\lib\manifest.ps1:36
Line |
  36 |      $app = $app.TrimStart('/')
     |      ~~~~~~~~~~~~~~~~~~~~~~~~~~
     | You cannot call a method on a null-valued expression.
Couldn't find manifest for ''.

Possible Solution

I tried delete lines [106, 108] and the comma in line 105 of python.json. And I installed 3.9.12 successfully.

Scoop and Buckets Version

PS> scoop -V
Current Scoop version:
v0.3.1 - Released at 2022-11-15

'main' bucket:
ae9dfa846 (HEAD -> master, origin/master, origin/HEAD) upx: Update to version 4.0.1

'versions' bucket:
08fe67af (HEAD -> master, origin/master, origin/HEAD) vim-tux: Update to version 9.0.0888

Scoop Config

PS> scoop config

aria2-enabled         : True
aria2-warning-enabled : False
last_update           : 2022/11/17 11:44:13
scoop_repo            : https://github.com/lukesampson/scoop
scoop_branch          : master

PowerShell Version

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional Softwares

No response

rashil2000 commented 1 year ago

Since the manifest now contains an ARM64 variant, installing older version can cause some problems now. Sorry, this is unavoidable 😒

niheaven commented 1 year ago

You are finding python 3.9, why not use scoop install versions/python39?

JayYoung2021 commented 1 year ago

You are finding python 3.9, why not use scoop install versions/python39?

I know it is an alternative solution of this bug but thanks anyway. 😘