Windows์ ์ฐ๋ถํฌ ํฐ๋ฏธ๋์ httpie๋ฅผ ์ค์นํ๋ ค๊ณ ํ ๋ ์ค๋ช
์์ ์๋ ๋ค์ ๋ช
๋ น์ค์ ์ฌ์ฉํฉ๋๋ค.
pip install --upgrade pip setuptools
pip install --upgrade httpie
http --version
๋ก ๋ฒ์ ์ ํ์ธํ๋ ค๊ณ ํฉ๋๋ค.
๊ทธ๋ฐ ๋ค์์ด ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
asoom$ http --version
Traceback (most recent call last):
File "/home/abdallah/.local/bin/http", line 8, in <module>
sys.exit(main())
File "/home/abdallah/.local/lib/python2.7/site-packages/httpie/__main__.py", line 10, in main
from .core import main
File "/home/abdallah/.local/lib/python2.7/site-packages/httpie/core.py", line 21
args: List[Union[str, bytes]] = sys.argv,
^
SyntaxError: invalid syntax
๋ค๋ฅธ http ๋ช ๋ น๊ณผ ๋์ผํ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.
์ด๋ฏธ ์๋ช ์ด ๋คํ Python 2๋ฅผ ์ฌ์ฉํฉ๋๋ค. httpie๋ ๋ฒ์ 2.0.0์์ Python 2 ์ง์์ ์ค๋จํ์ผ๋ฉฐ ์ด์ Python 3๊ณผ๋ง ํธํ๋ฉ๋๋ค.
Python 3๊ณผ ํจ๊ป ์ค์น๋ ๊ฒฝ์ฐ pip3
๋์ ์คํํ ์ ์์ต๋๋ค.
@exploide์ ์กฐ์ธ ์ธ์๋ ๋ค์ ๋ช ๋ น์ ์ฌ์ฉํ์ฌ Python 2.7์ ์ง์ํ๋ ์ด์ ๋ฒ์ ์ ์ค์นํ ์ ์์ต๋๋ค.
$ pip install 'httpie<2.0.0'
// #886
์ด๋ฏธ ์๋ช ์ด ๋คํ Python 2๋ฅผ ์ฌ์ฉํฉ๋๋ค. httpie๋ ๋ฒ์ 2.0.0์์ Python 2 ์ง์์ ์ค๋จํ์ผ๋ฉฐ ์ด์ Python 3๊ณผ๋ง ํธํ๋ฉ๋๋ค.
Python 3๊ณผ ํจ๊ป ์ค์น๋ ๊ฒฝ์ฐ
pip3
๋์ ์คํํ ์ ์์ต๋๋ค.
@exploide ์ @jakubroztocil ์๊ฒ ๊ฐ์ฌ๋ฅผ ํํ๊ธฐ ๋๋ฌธ์ ๊ธฐ๋ณธ ํ์ด์ฌ ๋ฒ์ ์ ๋ณ๊ฒฝํ๋ ๋ค๋ฅธ ๋ฐฉ๋ฒ์ ์๋ํฉ๋๋ค.
// ๋ ๊ฐ์ง ๋ค๋ฅธ Python ๋ฒ์ ์ ์ ์ํฉ๋๋ค.
sudo ์
๋ฐ์ดํธ ๋์ --install /usr/bin/python ํ์ด์ฌ /usr/bin/python2.7 1
sudo ์
๋ฐ์ดํธ ๋์ --install /usr/bin/python ํ์ด์ฌ /usr/bin/python3.6 2
// ๋ฒ์ 3.6์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก ์ ์๋์ด์ผ ํฉ๋๋ค.
sudo ์
๋ฐ์ดํธ ๋์ --set python /usr/bin/python3.6
์ด๊ฒ์ ์ด์ ํด๊ฒฐ๋์์ต๋๋ค โ pip install httpie
๋ ๋ชจ๋ Python ๋ฒ์ ์์ ์ ์๋ํฉ๋๋ค. ๊ทธ๋ ๊ธด ํ์ง๋ง Python 3์ผ๋ก ์
๊ทธ๋ ์ด๋ํ๋ ๊ฒ์ ์ ๋ง๋ก ๊ณ ๋ คํด์ผ ํฉ๋๋ค.