Skip to content

Instantly share code, notes, and snippets.

@jeffam
Created January 5, 2018 17:59
Show Gist options
  • Save jeffam/6d8efd9079bd81d2f829c65dd9f1eacd to your computer and use it in GitHub Desktop.
Save jeffam/6d8efd9079bd81d2f829c65dd9f1eacd to your computer and use it in GitHub Desktop.
Installing PIP Packages in macOS without Root

I needed mkdocs installed but didn't want to do it as root, and virtualenv is overkill for my current needs. Here's what I did:

$ easy_install --help | grep -A 3 -- --user

This returned:

  --user                     install in user site-package
                             '/Users/jeff/Library/Python/2.7/lib/python/site-
                             packages'

So that's where packages will be installed.

$ easy_install --user pip

Updated my $PATH to in ~/.bash_profile:

export PATH=/usr/local/bin:/usr/local/sbin:~/bin:$PATH:~/Library/Python/2.7/bin

Note the bit on the end.

After source ~/.bash_profile, pip was in my path, and I could do something like:

$ pip install --user mkdocs

I might not even need --user at this point. Didn't test.

Thanks to info here: http://kazhack.org/?post/2014/12/12/pip-gem-install-without-sudo#c1025

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