a.m.
a.m.

Reputation: 2208

How can I change default python version EMACS 23 uses?

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?

Upvotes: 8

Views: 3647

Answers (3)

Richard Huang
Richard Huang

Reputation: 947

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

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

Upvotes: 1

fgeller
fgeller

Reputation: 501

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")

Upvotes: 4

andrewdski
andrewdski

Reputation: 5515

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.

Upvotes: 3

Related Questions