How does PIP work with 2 Python distributions in OSX?

Posted by jjarava on 2015-06-02 08:26

Hi!

I'm having a hard time understanding the way `pip` is supposed to work when there's 2 Python distributions in the machine.

My setup:

- OSX 10.9.5
- Default Python (`2.7.5 (default, Mar 9 2014, 22:15:05)`)
- ActiveState Python (`2.7.8 (default, Jul 7 2014, 20:30:57)`)

My path is set to have `/usr/local/bin` placed **after** the default directories as I don't want to override the default utilities, but I want to be able to call them when needed. So the *default* `python` and `pip` would be the system ones:

        Mac-JJJ:~ jjarava$ which -a python
        /usr/bin/python
        /usr/local/bin/python
        Mac-JJJ:~ jjarava$ which -a pip
        /usr/bin/pip
        /usr/local/bin/pip

What I did to get it setup like that was to install pip in the "system" python with `sudo easy_install pip` and then `sudo mv pip* /usr/bin/`

After that, I install ActiveState that installs links to the different tools they package in /usr/local/bin, including "pip"

Both "pip" instances are working off different package lists:

        Mac-JJJ:~ jjarava$ /usr/bin/pip list | wc -l
              53
        Mac-JJJ:~ jjarava$ /usr/local/bin/pip list | wc -l
               7

Now, in my way of thinking about it, when I call `/usr/bin/pip` I would be adding/deleting packages for the "System" Python, while invoking `/usr/local/bin/pip` would affect the package repository associated with ActivePython...

But that doesn't seem to be the case. For example, when I install the "requests" package using the "system" PIP and I get the package listed in both "pip" listings.

So, am I missing something? Why the "ActiveState" pip doesn't list all the packages that the system one does, but after installing a new package with the "system" pip, it shows in both package lists?

That *does not* happen the other way round -- when I install a package with the "ActiveState" pip, I don't get it on the system list (which is the expected behaviour I'd say)

Thanks a lot for any pointers?!