Aside: Installing, and Setting, PIP with MacPorts

There’s a Python library, textblob, that I want to explore, but there is no current port of it for MacPorts. I like to keep as much stuff like this “in the family” as possible, and so I am going to see if a PIP selected by MacPorts will make this easy:

% port search pip

py27-pip @6.1.1 (python, www)
A tool for installing and managing Python packages.

% sudo port install py27-pip

A lot of stuff scrolls by, then:

% port select --list pip
Available versions for pip:
none (active)

% port select --set pip pip27
Selecting 'pip27' for 'pip' failed: could not create new link 
"/opt/local/bin/pip" pointing to "/opt/local/Library/
Frameworks/Python.framework/Versions/2.7/bin/pip": permission

So, sudo that:

% sudo port select --set pip pip27
Selecting 'pip27' for 'pip' succeeded. 'pip27' is now active.

Check my work:

 % which pip

2 thoughts on “Aside: Installing, and Setting, PIP with MacPorts

  1. I struggled a little with this – until I realised there are two l’s in install 😉
    % sudo port instal py27-pip should be
    % sudo port install py27-pip
    then all was smooth as silk.

    Thanks for the page, most helpful

  2. Sorry! (And thanks for catching that. I’ve fixed it in hopes that anyone else coming across this page won’t get caught by such a typo!) I’m glad it worked. Are you using textblog with Python 2.7? I decided to “jump” to 3.4 last year, and I’ve found almost everything works fine.

Leave a Reply