Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top