Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Cannot do brew python... #19426

dlei opened this Issue · 7 comments

5 participants


==> /usr/local/Cellar/python/2.7.3/bin/python -s --no-user-cfg install
File "/private/tmp/UNKNOWN-wAf5/distribute-0.6.35/", line 1211, in get_metadata
return self.get(self.fn(self.egg_info,name))
File "/private/tmp/__UNKNOWN
-wAf5/distribute-0.6.35/", line 1326, in _get
stream = open(path, 'rb')
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/httplib2-0.8-py2.7.egg/EGG-INFO/top_level.txt'
Error: Homebrew doesn't know what compiler versions ship with your version
of Xcode (4.6.2). Please brew update and if that doesn't help, file
an issue with the output of brew --config:

HEAD: df7f810
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.8.3-x86_64
Xcode: 4.6.2
LLVM-GCC: build 2336
Clang: 4.1 build 421
X11: N/A
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /Users/dlei/.rvm/rubies/ruby-1.9.3-p385/bin/ruby


What were you trying to install? Can you please read this, see if it helps, and post the requested logs:


I am trying to do brew install python...

What does this means?
IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/httplib2-0.8-py2.7.egg/EGG-INFO/top_level.txt'



I'm having the same problem when trying to brew python, with the exception that you're getting an reference to the file that's causing the problem with the brew, whereas mine doesn't tell me what the problematic file is.


You have probably some setuptools and/or distribute in /Library/Python/2.7/...
Test removing (or move it away) the /Library/Python/2.7/ dir and ~/Library/Python/2.7

Let me know if this helps.
I assume your PATH is so that /usr/local/bin comes first.


@samueljohn, I have /usr/local/share/python as the first entry in PATH, then /usr/local/bin. Is that Ok?

In any case, I put the setuptools* files in a ./tmp directory under /Library/Python/2.7 and re-ran brew install python and it went further, beyond the "Permission denied" error. It compiled everything but had trouble linking. It kindly suggested what the fixes would be, I followed the advice to "brew link --overwrite python" and that seemed to work. When I run python I'm told I'm using version 2.7.4, which is what I was trying to get to, so looks like things have sorted themselves out.

Thanks for your advice.



@cartesianJoin yes, this sounds good now from what you report. The issue was that a stray setuptools (from an older python installation) can lead to this error here. Not sure if I can find a proper fix, because it's the way python is designed to work (by that I mean python looks into /Library/Python to pick up additional packages).

@samueljohn samueljohn closed this
@samueljohn samueljohn was assigned

"IOError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/httplib2-0.8-py2.7.egg/EGG-INFO/top_level.txt' "

I had the same error, which seems the file's permission was set to None to everyone. I fixed it by going into the directory of '/Library/Python/2.7/site-packages/httplib2-0.8-py2.7.egg/EGG-INFO/top_level.txt' and changed the permission of the file to "READONLY" to "everyone".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.