Skip to content

Instantly share code, notes, and snippets.

@BlakeGardner
Last active November 5, 2020 08:43
Show Gist options
  • Save BlakeGardner/5586954 to your computer and use it in GitHub Desktop.
Save BlakeGardner/5586954 to your computer and use it in GitHub Desktop.
Install HTTPie Mac OS X

This is a quick guide on installing HTTPie for Mac OS X systems. This is also useful if you want the python package management utility pip. An installed copy of Homebrew is a prerequisite.

HTTPie

The easy way

brew install httpie

Manually via pip

# install the python package provided with homebrew
brew install python

# install HTTPie with the pip utility
pip install httpie

# add the shared python folder to your path
nano ~/.bash_profile

# Add the following line to your ~/.bash_profile
export PATH=/usr/local/share/python:$PATH

# open a new terminal and give it a go
http ifconfig.me/all.json
@cchacin
Copy link

cchacin commented Jul 25, 2014

Thanks

@nazariyg
Copy link

Or simply brew install httpie

@shahidghafoor00
Copy link

perfect !

@markwartman1
Copy link

My goal is to install HTTPie manually. I'm running OS X El Capitan 10.11.6

If I run which pip I get no response. If I run which pip3 I get:
/Library/Frameworks/Python.framework/Versions/3.6/bin/pip3

If I run python --version I get Python 2.7.10
If I run which python I get /usr/bin/python I assume this is from installing Xcode.

If I run which python3 I get /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
I installed PyCharm Edu and I am fairly certain it runs the Python 3.6 version. I also assume via this installation, my .bash_profile was given the following:
# Setting PATH for Python 3.6
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}" export PATH

My goal is to use HTTPie to run with Node if that helps. Should I run pip3 install httpie and follow the rest of the directions, or should I install a version of pip to my 2.7.10 version?

@crmpicco
Copy link

Handy, thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment