httpie/cli

Can't install a plugin because cannot invoke pip

philipmw opened this issue · 1 comments

Checklist

  • I've searched for similar issues.
  • I'm using the latest version of HTTPie.

Minimal reproduction code and steps

  1. Run httpie --debug --traceback cli plugins install ~/any/local/path/that-may-not-even-exist

Current result

% httpie --debug --traceback cli plugins install ~/aaaaa
HTTPie 3.2.2
Requests 2.31.0
Pygments 2.16.1
Python 3.12.0 (main, Oct  2 2023, 12:03:24) [Clang 15.0.0 (clang-1500.0.40.1)]
/usr/local/Cellar/httpie/3.2.2_3/libexec/bin/python
Darwin 23.1.0

<Environment {'apply_warnings_filter': <function Environment.apply_warnings_filter at 0x1107f3c40>,
 'args': Namespace(),
 'as_silent': <function Environment.as_silent at 0x1107f3b00>,
 'colors': 256,
 'config': {'default_options': []},
 'config_dir': PosixPath('/Users/pmw/.config/httpie'),
 'devnull': <property object at 0x1107e9850>,
 'is_windows': False,
 'log_error': <function Environment.log_error at 0x1107f3ba0>,
 'program_name': 'httpie',
 'quiet': 0,
 'rich_console': <functools.cached_property object at 0x1107e3290>,
 'rich_error_console': <functools.cached_property object at 0x1107e32f0>,
 'show_displays': True,
 'stderr': <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>,
 'stderr_isatty': True,
 'stdin': <_io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>,
 'stdin_encoding': 'utf-8',
 'stdin_isatty': True,
 'stdout': <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>,
 'stdout_encoding': 'utf-8',
 'stdout_isatty': True}>

<PluginManager {'adapters': [],
 'auth': [<class 'httpie.plugins.builtin.BasicAuthPlugin'>,
          <class 'httpie.plugins.builtin.DigestAuthPlugin'>,
          <class 'httpie.plugins.builtin.BearerAuthPlugin'>],
 'converters': [],
 'formatters': [<class 'httpie.output.formatters.headers.HeadersFormatter'>,
                <class 'httpie.output.formatters.json.JSONFormatter'>,
                <class 'httpie.output.formatters.xml.XMLFormatter'>,
                <class 'httpie.output.formatters.colors.ColorFormatter'>]}>
Installing /Users/pmw/aaaaa...
Command failed: pip install --prefer-binary --prefix=/Users/pmw/.config/httpie/plugins --no-warn-script-location /Users/pmw/aaaaa
  Can't install '/Users/pmw/aaaaa'

Me trying to debug the issue:

% pip
zsh: command not found: pip

Based on the HTTPie source code, it appears to be doing this:

% python3.12
Python 3.12.0 (main, Oct  2 2023, 12:03:24) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.which("pip")
>>> shutil.which("pip3")
'/usr/local/bin/pip3'
>>>

This works as expected.

Expected result

It finds pip3 (which does exist) and uses it.


Debug output

(already provided above)