httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
32.67k stars 3.68k forks source link

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

Closed ceecer1 closed 1 month ago

ceecer1 commented 8 months ago

Checklist


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

aliktb commented 8 months ago

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

BlakeGardner commented 8 months ago

I have the same issue as the commenters above.

julien-lesire commented 8 months ago

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

iloveitaly commented 8 months ago

That fixed it for me as well.

Ousret commented 1 month ago

As everyone in the thread figured out, it's not an issue with HTTPie itself. Maybe worthwhile to check if brew cask for HTTPie isn't broken. Will check it out soon. But immediately, it seems to be OK by my reading of https://formulae.brew.sh/api/formula/httpie.json