If python was installed via scoop, ggshield should be installed via pipx install ggshield --system-site-packages
#894
Open
Description
It would be great if this pitfall was noted in ggshield's installation instructions.
Environment
- ggshield version:
- Operating system (Linux, macOS, Windows): Windows 11 Pro
- Operating system version: 22H2 22621.3593
- Python version: 3.12.3
Describe the bug
The scoop python
package does not have ./Scripts/pip
and instead bootstraps pip to site-packages.
The scoop pipx
package does not automatically add --system-site-packages
if pip is not in Python's Scripts directory. Subsequent pipx install
runs will fail if pip is expected and --system-site-packages
is not added.
> pipx install ggshield
No Python at '"C:\Python312\python.exe'
No Python at '"C:\Python312\python.exe'
Fatal error from pip prevented installation. Full pip output in file:
C:\Users\Noah\pipx\logs\cmd_2024-05-22_20.04.23_pip_errors.log
Error installing ggshield.
> cat C:\Users\Noah\pipx\logs\cmd_2024-05-22_20.04.23_pip_errors.log
PIP STDOUT
----------
PIP STDERR
----------
C:\Users\Noah\pipx\venvs\ggshield\Scripts\python.exe: No module named pip
Steps to reproduce:
scoop install python
scoop install pipx
pipx install ggshield
fails
pipx install ggshield --system-site-packages
succeeds
Perhaps an issue should be raised over at https://github.com/pypa/pipx/issues (if one does not already exist) to address this programmatically.