8

Trying to change the version of python emacs uses. (OSX10.6)

In Terminal python brings up the version I've set up in PATH But in EMACS it does not.

How can I change this?

3 Answers 3

4

Another option is to look into fixing the environment variable PATH for Emacs which is a little tricky when using Emacs on Mac OS. Just make sure that Emacs' PATH has the same value as PATH in Terminal.app/Bash. These links should help:

Accessing OS X / UNIX environment variables in Emacs minibuffer

http://www.emacswiki.org/emacs/EmacsApp

(cf. Section "Path" and "Alternative Path Solution")

Sign up to request clarification or add additional context in comments.

1 Comment

+1 for pointing this out Emacs.app on Mac OS X does not inherit the same value of PATH environment variable as on another OS That was it actually Emacs.app doesn't do it right but if you just open Emacs through Terminal, the Python version is correct which would make sense.
3

The easiest way (assuming you are running the GUI version of Emacs), is to choose

Options->Customize Emacs->Specific Option

and type python-python-command, and fill in the path to the python you want. Then save for future sessions and you should be good.

I'm really not sure why it wouldn't be honoring the path variable. The default should be simply "python" (no path). Maybe you have already set this, or you are changing the command path in your .emacs? You could look in ~/.emacs and see if you are doing either of those.

3 Comments

...I feel extremely nooobish :\ .... I tried setting that to something like so /Library/Frameworks/Python.framework/Versions/2.7/Python which is where my python binary is. no dice. ...
It wants the full path to the executable, not just the directory. So /Library/Frameworks/Python.framework/Versions/2.7/Python/python might be what you want. (I'm at work now, so no Mac OSX to check with :(.)
Well I gave up and switched to Aquamacs. Too bad yasnippets doesn't work in HTML mode in Aquamacs.
1

Try to add this to your .emacs or other config file:

(setq python-version-checked t)
(setq python-python-command "python2.7")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.