httpie/cli

Does not work with a small easy peasy sample 'http -f requests.http'

ceecer1 opened this issue · 5 comments

Checklist

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

Minimal reproduction code and steps

  1. Create a .http file, e.g. file.http
  2. Try execute, http -f file.http

Current result

Traceback (most recent call last):
File "/opt/homebrew/bin/http", line 8, in
sys.exit(main())
^^^^^^
File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/httpie/main.py", line 8, in main
from httpie.core import main
File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/httpie/core.py", line 8, in
import requests
File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/init.py", line 147, in
from . import packages, utils
File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/utils.py", line 24, in
from . import certs
File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/certs.py", line 14, in
from certifi import where
ModuleNotFoundError: No module named 'certifi'

Expected result

The current result is malfunction since 'certifi' module is there as well.


Debug output

Please re-run the command with --debug, then copy the entire command & output and paste both below:

$ http --debug -f product_requests.http
Traceback (most recent call last):
  File "/opt/homebrew/bin/http", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/httpie/__main__.py", line 8, in main
    from httpie.core import main
  File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/httpie/core.py", line 8, in <module>
    import requests
  File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/__init__.py", line 147, in <module>
    from . import packages, utils
  File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/utils.py", line 24, in <module>
    from . import certs
  File "/opt/homebrew/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/certs.py", line 14, in <module>
    from certifi import where
ModuleNotFoundError: No module named 'certifi'

Additional information, screenshots, or code examples

yep, same issue here running a simple command as noted in the usage examples:

https httpie.io/hello

throws this error:

Traceback (most recent call last):
  File "/usr/local/bin/https", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/httpie/__main__.py", line 8, in main
    from httpie.core import main
  File "/usr/local/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/httpie/core.py", line 8, in <module>
    import requests
  File "/usr/local/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/__init__.py", line 147, in <module>
    from . import packages, utils
  File "/usr/local/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/utils.py", line 24, in <module>
    from . import certs
  File "/usr/local/Cellar/httpie/3.2.2_2/libexec/lib/python3.12/site-packages/requests/certs.py", line 14, in <module>
    from certifi import where
ModuleNotFoundError: No module named 'certifi'

Not sure if I'm doing anything wrong. Have installed it with brew install httpie but can't get anything other than this error

I have the same issue as the commenters above.

This fixed it for me:
/opt/homebrew/Cellar/httpie/3.2.2_3/libexec/bin/python3 -m pip install setuptools Pygments certifi

That fixed it for me as well.