Brew๋ macOS์ httpie๋ฅผ ์ค์นํ๋ ๊ถ์ฅ ๋ฐฉ๋ฒ์ผ๋ก ๋์ด๋ฉ๋๋ค. ๊ทธ๋ฌ๋ ์ธ์ฆ ํ๋ฌ๊ทธ์ธ์์๋ ์๋ํ์ง ์์ต๋๋ค.
์๋ฅผ ๋ค์ด pip3 install requests-hawk
๋ค์ ์คํํ๋ฉด http --help
hawk๊ฐ ์ธ์ฆ ์ ํ์ผ๋ก ํ์๋์ง ์์ต๋๋ค. pip3 install httpie-oauth
๊ฒฝ์ฐ pip๋ฅผ ํตํด httpie๋ฅผ ์ข
์์ฑ์ผ๋ก ์ค์นํ๊ณ /usr/local/bin/http
์์๋ brew ์ค์น ๋งํฌ๋ฅผ ๋ฎ์ด ์๋๋ค. ์ด์ brew ์ค์น ๋ฒ์ ์ ์ฌ์ฉํ์ง ์๊ธฐ ๋๋ฌธ์ ๋ชจ๋ ํ๋ฌ๊ทธ์ธ์ด ํ์๋ฉ๋๋ค.
macOS์ ๊ถ์ฅ๋๋ ์ค์น ๋ฐฉ๋ฒ์ผ๋ก pip3 install httpie
๋ฅผ ์ฝ๋๋ก ์ค๋ช
์๋ฅผ ๋ณ๊ฒฝํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
@rshurts ๋น์ ์ด ๋ง์์. Homebrew ๊ธฐ๋ฐ ์ค์น์ฉ ํ๋ฌ๊ทธ์ธ ์ค์น๋ ๊ธฐ๋ณธ์ ์ผ๋ก ์๋ํ์ง ์์ต๋๋ค.
๊ทธ๋ฌ๋ Homebrew๋ฅผ ๊ถ์ฅ๋๋ ๋ฐฉ๋ฒ์ผ๋ก ์ ์งํ๋ฉด ์ฅ์ ์ด ์์ต๋๋ค. ์ฝ๊ฒ ์ ๋ฐ์ดํธ ํ ์ ์์ผ๋ฉฐ ๊ธฐ๋ณธ ํจํค์ง๋ Python 3 (ํฅ์๋ SSL ์ง์ ๋ฑ)์ ์์กด ํ ์ ์์ต๋๋ค.
์ด์์ ์ธ ์๋ฃจ์
์ ๋ชจ๋ ํ๋ฌ๊ทธ์ธ์ Homebrew ํจํค์ง ( brew install httpie-oauth
)๋ก ์ฌ์ฉํ ์ ์๋๋กํ๋ ๊ฒ์
๋๋ค. ๊ทธ๋ฌ๋ ๊ทธ๊ฒ์ ๊ด๋ฆฌ์์๊ฒ ์ถ๊ฐ ์์
์ ์๋ฏธํ๋ฏ๋ก ๋ชจ๋ ํ๋ฌ๊ทธ์ธ์ด Homebrew๋ก ๋๋๋ ๊ฒ์ ์๋๋๋ค.
pip
๋ฅผ ์ฌ์ฉํ์ฌ ํ๋ฌ๊ทธ์ธ์ ์ค์นํ๋ ๊ฒ์ด ๋ ์ฌ์ด ๋ฐฉ๋ฒ์ฒ๋ผ ๋ณด์
๋๋ค. Hombrew์ ํจ๊ป ์๋ํ๊ฒํ๋ ค๋ฉด pip
์์ (ํ์ฌ) /usr/local/Cellar/httpie/0.9.8_2/libexec/lib/python3.6/site-packages
๋ฅผ ์ค์น ๋๋ ํ ๋ฆฌ๋ก ์ฌ์ฉํ๋๋ก ์ง์ํด์ผํฉ๋๋ค.
๊ทธ๋ฌ๋ ๊ฑฐ๊ธฐ์ ์ค์น๋ ํ๋ฌ๊ทธ์ธ์ HTTPie ์ ๊ทธ๋ ์ด๋์์ ์ด์๋จ์ง ๋ชปํฉ๋๋ค.
์๋ฅผ ๋ค์ด, Homebrew Python 3 site-packages
์์ HTTPie๊ฐ ์ค์น๋ ํ๋ฌ๊ทธ์ธ์๋ก๋ ํ ์ ์๋๋ก Homebrew ๊ณต์ ์ ์กฐ์ ํ ์ ์์ต๋๋ค (์๊ตฌ์ ์ธ์ง ํ์คํ์ง ์์). ๋๋ ๋ค๋ฅธ ์์น์์.
โฆ ๋๋ ์ผ์ข ์ ๋ง์ถคํ ํ๋ฌ๊ทธ์ธ ์ค์น ํ๋ก๊ทธ๋จ.
๊ทธ ๋์ ํ๋ฌ๊ทธ์ธ์ ๊ดํ ๋ฌธ์์์ "brew๋ ํ๋ฌ๊ทธ์ธ์์ ์๋ํ์ง ์์ผ๋ฉฐ ํ๋ฌ๊ทธ์ธ ๊ธฐ๋ฅ์ ์ํด httpie๋ฅผ ์ค์นํ๋ ค๋ฉด pip ์ค์น"๋ผ๋ ๋ฉ๋ชจ๊ฐ ์์ผ๋ฉด ๋ํต์ ๋ ์ ์์ต๋๋ค.
์ฌ์ฉ์์๊ฒ ๊ด๋ฆฌ์ ๊ถํ์ด์๋ ๊ฒฝ์ฐ ์ฝ๊ธฐ ๊ถํ์ ๋ฌธ์ ๊ฐ ์์ต๋๋ค.
$ http --help
Traceback (most recent call last):
File "/usr/local/bin/http", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3123, in <module>
<strong i="6">@_call_aside</strong>
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3107, in _call_aside
f(*args, **kwargs)
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3136, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 569, in _build_master
ws = cls()
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 562, in __init__
self.add_entry(entry)
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 618, in add_entry
for dist in find_distributions(entry, True):
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1965, in find_on_path
for dist in factory(fullpath):
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2035, in distributions_from_metadata
root, entry, metadata, precedence=DEVELOP_DIST,
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2492, in from_location
py_version=py_version, platform=platform, **kw
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2867, in _reload_version
md_version = _version_from_file(self._get_metadata(self.PKG_INFO))
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2456, in _version_from_file
line = next(iter(version_lines), '')
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2646, in _get_metadata
for line in self.get_metadata_lines(name):
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1411, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1407, in get_metadata
value = self._get(self._fn(self.egg_info, name))
File "/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1519, in _get
with open(path, 'rb') as stream:
PermissionError: [Errno 13] Permission denied: '/usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/idna-2.7-py3.7.egg-info/PKG-INFO'
๋๋ ๊ทธ๊ฒ์ ๊ณ ์น ์ ์์๋ค
chmod +r /usr/local/Cellar/httpie/1.0.0/libexec/lib/python3.7/site-packages/idna-2.7-py3.7.egg-info/PKG-INFO
ํ์ง๋ง ํ๋ฌ๊ทธ์ธ ์ค์น๊ฐ ๋ ์ฌ์ ์ก๊ธฐ ๋๋ฌธ์ pip3 install httpie
๋ก ์ ํํ์ต๋๋ค.
10.14 Mojave๋ก ์
๊ทธ๋ ์ด๋ ํ ํ ์์ pip3 list
๋ ์๋ง๋ ์ด๊ธฐ Python ๋ฒ๋ค์ ํฌํจ ๋ ํญ๋ชฉ 3 ๊ฐ๋ง ํ์ํฉ๋๋ค.
์ด๊ฒ์ ๊ทผ๋ณธ์ ์ผ๋ก Python3 ๋ฌธ์ ์ ๋๊น (์ ์ด๋ homebrew๋ฅผ ํตํด ์ค์น๋ Python)? ๊ด๋ฆฌ์์๊ฒ๋ณด๊ณ ํด์ผํฉ๋๊น?
๊ทธ๋งํ ๊ฐ์น์ ๋ต๋ณ์ ๊ตฌํ๋ ๋ค๋ฅธ ์ฌ์ฉ์์ ๊ฒฝ์ฐ ํ๋ฌ๊ทธ์ธ ์ค์น๊ฐ ๋ค์๊ณผ ๊ฐ์ด ์ ์๋ํ์ต๋๋ค.
pip3 install -t /usr/local/Cellar/httpie/2.0.0/libexec/lib/python3.8/site-packages httpie-jwt-auth
๊ฐ์ฌํฉ๋๋ค https://github.com/jakubroztocil/httpie/issues/566#issuecomment -285210693
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๊ทธ ๋์ ํ๋ฌ๊ทธ์ธ์ ๊ดํ ๋ฌธ์์์ "brew๋ ํ๋ฌ๊ทธ์ธ์์ ์๋ํ์ง ์์ผ๋ฉฐ ํ๋ฌ๊ทธ์ธ ๊ธฐ๋ฅ์ ์ํด httpie๋ฅผ ์ค์นํ๋ ค๋ฉด pip ์ค์น"๋ผ๋ ๋ฉ๋ชจ๊ฐ ์์ผ๋ฉด ๋ํต์ ๋ ์ ์์ต๋๋ค.