GitGuardian / ggshield

Find and fix 360+ types of hardcoded secrets and 70+ types of infrastructure-as-code misconfigurations.
https://gitguardian.com
MIT License
1.57k stars 138 forks source link

If python was installed via scoop, ggshield should be installed via `pipx install ggshield --system-site-packages` #894

Open BinToss opened 1 month ago

BinToss commented 1 month ago

It would be great if this pitfall was noted in ggshield's installation instructions.

Environment

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:

  1. scoop install python
  2. scoop install pipx
  3. pipx install ggshield

    fails

  4. 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.