Pymacs not starting on Emacs24 Carbon

戏子无情 提交于 2019-12-05 02:30:48

问题


I've followed the EnigmaCurry instructions for setting up a good python IDE in emacs. I didn't follow verbatim, since a bit has changed in emacs24 and I use customizer heavily to set options. In any case, when I was setting up flymake, I ran into a problem whereby Carbon Emacs doesn't have the same PATH as my shell, which I fixed by doing this.

I suspect something similar is happening with pymacs. Starting emacs, I get this error:

error: Pymacs helper did not start within 30 seconds

Inspecting the *Pymacs* buffer, I note:

ImportError: No module named Pymacs

My site-packages directory is in both my PATH and PYTHONPATH variables, but emacs seems to be overriding PYTHONPATH. To illustrate, if I type python -c "import sys; print sys.path" in a shell, I get:

['', '/usr/local/Cellar/python/2.7.2/ ... *snip* ]

But if I do the same in emacs through M-! python -c "import sys; print sys.path" [RET], I get:

['', '/usr/local/share/python',
     '/System/Library/Frameworks/Python.framework/Versions/2.6/ ... *snip* ]

IIUC, this means emacs is picking up the Mac factory default python framework, in addition to correctly picking up my manually created PYTHONPATH shell variable (the second list item). Yet, pymacs can't be found.

I've set python-python-command to python2.7 even though the correct python is ahead of that on the path. That is, python --version in a shell is 2.7, but in emacs it is 2.6.

I'm running the latest carbon emacs24 installed using homebrew.


回答1:


Updated Solution

The best thing to do if you are on Mac OS X is to edit the /etc/path file, as documented in this superuser question and my own. If your symptoms are similar, I would try this solution first.

Original Solution

While writing up this question, I found the solution that worked for me. For my setup, changing neither python-python-command nor py-python-command fixed the problem.

The Pymacs documentation suggested that setting the PYMACS_PYTHON variable usually wasn't needed, but when I used (setenv "PYMACS_PYTHON" "python2.7") in my init file, it cleared up that error.

I'm still working on a few other hiccups, but this part seems resolved.



来源:https://stackoverflow.com/questions/9386205/pymacs-not-starting-on-emacs24-carbon

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