Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing python interpreter for emacs

Tags:

python

emacs

Emacs uses an older version of python(2.3) i have for the default python mode, is there a way for me to tell emacs to use the newer version that i have in my home directory?

btw I'm using a red hat distro and dont have root privileges.

like image 692
sam Avatar asked Mar 25 '10 13:03

sam


2 Answers

It is good habit to check customize-group of things you wanna tweak. Just do:

M-x customize-group RET python RET

you've got now multiple options of which one should be interesting:

Python Python Command

You can customize it there and Save for further sessions.

like image 89
radekg Avatar answered Oct 18 '22 09:10

radekg


Via .emacs:

Try to add to your ~/.emacs file:

(setq python-python-command "~/your/python/bin-dir/python")

or

Via the shell environment:

The python command that is run by Emacs is typically python, so you can try the simple approach of changing your path:

export PATH=~/your/python/bin-dir:$PATH
like image 38
Chen Levy Avatar answered Oct 18 '22 09:10

Chen Levy