brew install python fails #14931

mwurth opened this Issue Sep 14, 2012 · 8 comments


None yet

3 participants

mwurth commented Sep 14, 2012

I want to install python through homebrew but it fails with a not very informative error. See here:

Error: Failed executing: /usr/local/Cellar/python/2.7.3/bin/python --no-user-cfg install --force (python.rb:153)

Full log:

brew doctor is clean (Your system is raring to brew.).

Any ideas on where to start fixing this?


@mwurth thanks for the report. From the install log, I see that "/usr/local/bin/ginstall" is being used. I don't think that comes from homebrew, so I assume other things in /usr/local/bin may also be from a different source and interfere here.
Otherwise the log does indeed give little clue. Python itself installs fine but distribute fails without any leaving any useful output. (Makes me think that we should call python for distribute also with --verbose)

Can you please tell what which python displays on your system?


Can you pls also gist your output of env. I am puzzled about why the failed command "python ..." did not show verbose output.

Can you, perhaps, brew edit python and then just for testing add a , "--verbose" to line 153 so that it looks like { system "#{bin}/python", "", "--no-user-cfg", "install", "--force", "--verbose" }

and then again try to brew install python --verbose. Hopefully we see some output for the failing command then.


Do other formula install fine? I am still suspicious about /usr/local/bin/ginstall which should read /usr/bin/install.
Which formula are installed (brew list)?
The output of brew list --unbrewed would help me (please also gist).

mwurth commented Sep 14, 2012

Thanks for taking the time to look into my issue. Here is the additional information you requested:
I clipped some lines from the brew list --unbrewed as the textfile was 12mb big (Tex2011 and Tex2012).

The error seems to be here:

Removing elements out of the way...
Renaming /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools-0.6c12dev_r85381-py2.7.egg-info into /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools-0.6c12dev_r85381-py2.7.egg-info.OLD.1347620054.48
Traceback (most recent call last):
  File "", line 131, in <module>
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/", line 363, in _before_install
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/", line 420, in _fake_setuptools
    res = _remove_flat_installation(setuptools_location)
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/", line 224, in __no_sandbox
    return function(*args, **kw)
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/", line 279, in _remove_flat_installation
    patched = _patch_egg_dir(pkg_info)
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/", line 224, in __no_sandbox
    return function(*args, **kw)
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/", line 347, in _patch_egg_dir
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/", line 259, in _rename_path
    os.rename(path, new_name)
OSError: [Errno 13] Permission denied
==> Exit Status: 1

Would it be save to just delete the offending file?


No, don't delete!


For some reason (I still cant figure out), the brewed python is not picked up first by distribute. Usually this can have one of the following reasons (which don't match for you I think from reading the provided infos):

  • PYTHONHOME was set to point to another (system's) python
  • /usr/bin is upfront in path and therefore python-config of the system is used.
  • A .pydistutils.cfg is in the home or somewhere

So we don't want to overwrite OS X's python. And normally that should not happen.

Ok, to carry on, perhaps which python and python-config --prefix can help me here.
Further, if you fire up python and import sys; sys.path what does it show?


Well is bin/ginstall not in your brew list --unbrewed output? Perhaps it was clipped?

I thought that may be python tried to use the /usr/local/bin/ginstall instead of /bin/install and then failed, so that later distribute only find the system python and not the newly brewed one.

adamv commented Sep 14, 2012

Duplicate of #14712.

@adamv adamv closed this Sep 14, 2012
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.