cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open ceecer1 opened this issue 2 years ago • 4 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

…

ceecer1 avatar Oct 16 '23 04:10 ceecer1

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

aliktb avatar Oct 16 '23 18:10 aliktb

I have the same issue as the commenters above.

BlakeGardner avatar Oct 18 '23 14:10 BlakeGardner

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

julien-lesire avatar Oct 20 '23 06:10 julien-lesire

That fixed it for me as well.

iloveitaly avatar Oct 21 '23 12:10 iloveitaly

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

Ousret avatar May 21 '24 05:05 Ousret