I'm using a nightly build of Emacs.app 24 from Emacs For OS X on OS X 10.7. After loading in my foo.py script everything works fine, except when I click "Start interpreter" from the menu bar Emacs starts the default 2.7 interpreter and fails to run my scripts written in Python 3.2. Is there any way to customize it, so that it starts the 3.2 interpreter?

I've tried (setq py-python-command "python3") in my .emacs, but it still starts the default 2.7.

  • Have you tried using a fully qualified path to your python interpreter? – OldWolf Oct 15 '11 at 2:45
  • yes; doesn't help. I can do M-x shell then python3.2, but evaluating scripts in python-mode always brings up the 2.7 interpreter. – idclark Oct 15 '11 at 4:02

M-x python3

should do it.

if not, please get latest source:


if still not working, please file a bug report at


| improve this answer | |

You may want to look at the posts here on Stack Overflow It looks like someone had a similar problem (though they wanted to be able to switch between interpreters.)

| improve this answer | |

You can customize the variable

(setq python-shell-interpreter "python3")

C-h v python-shell-interpreter says

Documentation: Default Python interpreter for shell.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.