Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

brew install python fails #14931

Closed
mwurth opened this Issue · 8 comments

3 participants

mwurth Samuel John Adam Vandenberg
mwurth

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 setup.py --no-user-cfg install --force (python.rb:153)

Full log:
https://gist.github.com/3721013

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

Any ideas on where to start fixing this?
Thanks!

Samuel John

@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 setup.py for distribute also with --verbose)

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

Samuel John

Can you pls also gist your output of env. I am puzzled about why the failed command "python setup.py ..." 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

Distribute.new.brew { system "#{bin}/python", "setup.py", "--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.

Samuel John

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

Thanks for taking the time to look into my issue. Here is the additional information you requested:

https://gist.github.com/d19b89d93f0d56d72b9f
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 "setup.py", line 131, in <module>
    _before_install()
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/distribute_setup.py", line 363, in _before_install
    _fake_setuptools()
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/distribute_setup.py", line 420, in _fake_setuptools
    res = _remove_flat_installation(setuptools_location)
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/distribute_setup.py", line 224, in __no_sandbox
    return function(*args, **kw)
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/distribute_setup.py", 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/distribute_setup.py", line 224, in __no_sandbox
    return function(*args, **kw)
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/distribute_setup.py", line 347, in _patch_egg_dir
    _rename_path(path)
  File "/private/tmp/brew-__UNKNOWN__-0.6.28-A79V/distribute-0.6.28/distribute_setup.py", 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?

Samuel John

No, don't delete!

Samuel John

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?

Samuel John

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.

Adam Vandenberg
Owner

Duplicate of #14712.

Adam Vandenberg adamv closed this
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.