ScoopInstaller / Main

📦 The default bucket for Scoop.
https://scoop.sh
The Unlicense
1.58k stars 950 forks source link

[Bug]: python does not set PATH envvar correctly post install anymore, pip.exe not found #5025

Closed gyroplast closed 1 year ago

gyroplast commented 1 year ago

Prerequisites

Package Name

python

Expected/Current Behaviour

Installation in a clean Win10 container with scoop install python warns in post_install that pip is not in PATH, which may (and does) lead to problems. Two days ago, the exact same installation procedure with the exact same base image worked as expected, and pip was accessible in PATH, and no warning was printed.

Steps to Reproduce

[...]
Step 5/11 : RUN scoop install python
 ---> Running in e19d5cfa3e67
Updating Scoop...
Updating 'main' bucket...
 Converting 'main' bucket to git repo...
Checking repo... OK
The main bucket was added successfully.
Scoop was updated successfully!
Installing 'dark' (3.11.2) [64bit] from main bucket
Downloading https://raw.githubusercontent.com/ScoopInstaller/Binary/master/dark/dark-3.11.2.zip (3.5 MB)...
Checking hash of dark-3.11.2.zip ... ok.
Extracting dark-3.11.2.zip ... done.
Linking ~\scoop\apps\dark\current => ~\scoop\apps\dark\3.11.2
Creating shim for 'dark'.
'dark' (3.11.2) was installed successfully!
Installing 'python' (3.11.4) [64bit] from main bucket
Downloading https://www.python.org/ftp/python/3.11.4/python-3.11.4-amd64.exe#/setup.exe (24.2 MB)...
Checking hash of python-3.11.4-amd64.exe ... ok.
Running pre_install script...
Running installer script...
Linking ~\scoop\apps\python\current => ~\scoop\apps\python\3.11.4
Creating shim for 'python3'.
Creating shim for 'idle'.
Creating shim for 'idle3'.
Persisting Scripts
Persisting Lib\site-packages
Running post_install script...
  WARNING: The scripts pip.exe, pip3.11.exe and pip3.exe are installed in 'C:\Users\ContainerAdministrator\scoop\apps\python\current\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

'python' (3.11.4) was installed successfully!
Notes
-----
Allow applications and third-party installers to find python by running:
"C:\Users\ContainerAdministrator\scoop\apps\python\current\install-pep-514.reg"
Removing intermediate container e19d5cfa3e67
 ---> e549f12a9b03
Step 6/11 : RUN pip install conan~=2.0
 ---> Running in 05c8ccf9c11c
'pip' is not recognized as an internal or external command,
operable program or batch file.
The command 'cmd /S /C pip install conan~=2.0' returned a non-zero code: 1

Possible Solution

There's a commit afb001c8 pushed yesterday from @HUMORCE, likely intended to handle the redis rollback in issue #5023, which inadvertently also changes the env_add_path in python.json from "Scripts" to "$persist_dir\\Scripts". Reverting this change, and installing from that manifest, then works as intended.

I'll provide a trivial PR, in case that makes things easier. HTH.

Scoop and Buckets Version

Current Scoop version:
v0.3.1 - Released at 2022-11-15

'main' bucket:
cc372e919 dnsproxy: Add arm64 version (#5020)

Scoop Config

last_update                       scoop_branch scoop_repo                      
-----------                       ------------ ----------                      
2023-08-17T18:00:30.3667403+02:00 master       https://github.com/ScoopInsta...

PowerShell Version

cmd.exe /S /C ver
Microsoft Windows [Version 10.0.20348.1366]

Additional Softwares

No response

HUMORCE commented 1 year ago

Sorry, I checking a python issue when making change for redis.