How to make Emacs pickup the correct python in Snow Leopard?

Deadly 提交于 2019-12-23 03:52:06

问题


Related to my previous question: Pymacs not starting on Emacs24 Carbon

Ropemacs won't load, since emacs isn't seeing the correct site-packages directory (see the previous question for example output).

I'm using Snow Leopard, with the dev version of emacs24 installed through homebrew.

$ emacs --version
GNU Emacs 24.0.93.1

Python is also installed through homebrew, and preferred by setting it at the front of my path.

$ python --version
Python 2.7.2

I use zsh as my login shell.

If I type M-! python --version into emacs, it returns Python 2.6.1, even though in my shell, /usr/local/bin is ahead of /usr/bin in my PATH. Indeed, emacs thinks my path is "reversed", in the sense that the default Python framework is ahead of my preferred python. I think this may be caused by path_helper.

zsh PATH:

$ echo $PATH
/Users/jrhorn424/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin: *snip*

emacs PATH:

M-! echo $PATH [RET]
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin: *snip*

I have the zsh path copied into ~/.MacOSX/environment.plist, but that doesn't prevent /usr/bin from prefixing in emacs.

Possibly related: Emacs is ignoring my path when it runs a compile command

I've implemented that solution, which is included in this list of solutions to the PATH problem, but I'm still getting the results above. Perhaps these solutions are a bit dated?

Telling me to upgrade to Lion, if you can convince me it will solve my issue, is OK, but I would prefer to stay with Snow Leopard for now.


回答1:


Edit /etc/path (as an administrator) and move the line /usr/local/bin to the top of the file.



来源:https://stackoverflow.com/questions/9388315/how-to-make-emacs-pickup-the-correct-python-in-snow-leopard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!