5

Okay, so I have brew, and I've brew reinstalled python since El Capitan.

MacBook-Pro-2:decipher Alex$ which python
/usr/local/bin/python
MacBook-Pro-2:decipher Alex$ whereis python
/usr/bin/python

I have two pythons. That's all well and good. Brew doctor is clean, except for some Unbrewed header files were found in /usr/local/include, none of which seem related to Python. Short of virtualenv, is there any way to install packages anymore? I feel like I might be missing something.

Just like this guy I was trying to get IPython. I don't really need it, so I gave up the other day. Now I need Pylint. If I try to install it with pip:

IOError: [Errno 13] Permission denied: '/lib/python2.7/site-packages/logilab_common-1.1.0-py2.7-nspkg.pth'

Does anyone know how to point pip towards another instance of python on my system, or do something else so I can have the old behavior back? Please?

-- EDITS --

Suggested was the idea of using /usr/local/bin/pip to install ipython. This is the output. I can't figure out how to use ipython still.

MacBook-Pro-2:MNIST Alex$ /usr/local/bin/pip install ipython[all]

Requirement already satisfied (use --upgrade to upgrade): ipython[all] in /Library/Python/2.7/site-packages
Requirement already satisfied (use --upgrade to upgrade): traitlets in /usr/local/bin (from ipython[all])
Requirement already satisfied (use --upgrade to upgrade): pickleshare in /usr/local/bin (from ipython[all])
Requirement already satisfied (use --upgrade to upgrade): simplegeneric>0.8 in /usr/local/bin (from ipython[all])
... the rest of the requirements are all satisfied in usr/local/bin
Community
  • 1
  • 1
Alex Lenail
  • 12,992
  • 10
  • 47
  • 79
  • Or pip install --user – JulienD Nov 24 '15 at 23:29
  • pip install --user seems to work. I don't think you're supposed to use sudo, like the guy mentions in the other stackoverflow post I linked to. – Alex Lenail Nov 25 '15 at 15:40
  • There is something wrong with your setup as a thing called `/lib` should not exist on OSX or Homebrew install: `ls /lib /usr/local/bin/gls: cannot access /lib: No such file or directory` – Mikko Ohtamaa Nov 25 '15 at 18:36
  • how peculiar. I have /lib/ and inside, there's **only** python2.7 How did that happen? How do I fix it? – Alex Lenail Nov 25 '15 at 18:39

3 Answers3

1

I had trouble too with El Capitan. I did these things and it worked:

1) Install Homebrew

2) Install Python 3 with Homebrew

3) In terminal enter these installs (in this order)

    $ pip3 install pyobjc-core
    $ pip3 install pyobjc
    $ pip3 install pillow
    $ pip3 install pyautogui
0

To point pip to another Python instance of your system, you need to use pip from the same bin/ folder where python is installed so it resolves to the same site-packages.

Example:

/usr/local/bin/pip install logilab_common

To make /usr/local/ writable by a local user on OSX do:

sudo chown -R `whoami`:admin /usr/local/*

More information

Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435
0

As Mikko Ohtamaa points out in the comments, somehow, I had a version of python in a folder called /lib. I'm not sure how it got there. I think that's the version of python I was using. Once I just sudo rm -rf /lib everything suddenly worked.

Alex Lenail
  • 12,992
  • 10
  • 47
  • 79