Skip to content

Instantly share code, notes, and snippets.

@mahmoudimus
Created March 28, 2015 21:51
Show Gist options
  • Save mahmoudimus/3ccaf9811e50fcd2a410 to your computer and use it in GitHub Desktop.
Save mahmoudimus/3ccaf9811e50fcd2a410 to your computer and use it in GitHub Desktop.
Emacs' anaconda-mode on MacOSX with Brewed Python

Background

You installed anaconda-mode and you've enabled it for use in Emacs. You also used homebrew to install your python distrubution. You open up a python file with anaconda-mode on.

Issue

You see a quick flash of Blocking call to accept-process-output with quit inhibited!! across your minibuffer. You switch to *messages* to see the errors and you see:

Blocking call to accept-process-output with quit inhibited!! [52 times]
End of buffer
Blocking call to accept-process-output with quit inhibited!! [307 times]
Quit [2 times]
Blocking call to accept-process-output with quit inhibited!! [101 times]

WTF?

Confirmation of Issue

Check your *anaconda-mode* buffer and you might see this:

Installing collected packages: six, service-factory, jedi
�[31m  Exception:
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 232, in main
      status = self.run(options, args)
    File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 347, in run
      root=options.root_path,
    File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 549, in install
      **kwargs
    File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 751, in install
      self.move_wheel_files(self.source_dir, root=root)
    File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 960, in move_wheel_files
      isolated=self.isolated,
    File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 137, in move_wheel_files
      name, user=user, home=home, root=root, isolated=isolated
    File "/usr/local/lib/python2.7/site-packages/pip/locations.py", line 236, in distutils_scheme
      i.finalize_options()
    File "build/bdist.macosx-10.10-intel/egg/setuptools/command/install.py", line 38, in finalize_options
      orig.install.finalize_options(self)
    File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/install.py", line 264, in finalize_options
      "must supply either home or prefix/exec-prefix -- not both"
  DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both
�[0m
Traceback (most recent call last):
  File "/Users/mahmoud/.emacs.d/elpa/anaconda-mode-20150313.655/anaconda_mode.py", line 40, in <module>
    assert pip.returncode is 0, 'PyPi installation fails.'
AssertionError: PyPi installation fails.

Workaround / Fix

Open up ~/.pydistutils.cfg and add this in there:

[install]
prefix=

See this for more: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md#note-on-pip-install---user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment