Open philipmw opened 8 months ago
By looking at HTTPie code, this should not happen. I think that the bug is specific to your OS/configured path. Somehow fooling us.
This does not mean HTTPie cannot handle that rare case. In order for us to understand,
Please run the following script, untouched, and return the results here.
from __future__ import annotations
import shutil
import subprocess
from contextlib import suppress
def _discover_system_pip() -> str:
def _check_pip_version(pip_location: str | None) -> bool:
if not pip_location:
print("D")
return False
with suppress(subprocess.CalledProcessError):
stdout = subprocess.check_output([pip_location, "--version"], text=True)
print(stdout)
return "python 3" in stdout
targets = [
"pip",
"pip3"
]
for target in targets:
print("A", target)
pip_location = shutil.which(target)
print("B", pip_location)
if _check_pip_version(pip_location):
print("C")
return pip_location
raise SystemError("Couldn't find 'pip' executable. Please ensure that pip in your system is available.")
if __name__ == "__main__":
print("debug issue https://github.com/httpie/cli/issues/1539")
print(_discover_system_pip())
Checklist
Minimal reproduction code and steps
httpie --debug --traceback cli plugins install ~/any/local/path/that-may-not-even-exist
Current result
Me trying to debug the issue:
Based on the HTTPie source code, it appears to be doing this:
This works as expected.
Expected result
It finds
pip3
(which does exist) and uses it.Debug output
(already provided above)