I've recently install Python 3.1, but Emacs still uses 2.6.5. I'm using Emacs version 开发者_如何学编程22.2.1. I'm not sure which files to edit in order to make Emacs use Python 3.1 by default!
I'm using python-mode.el and pyemacs, if that helps...
Best, Georgina
See a previous discussion on this
- Both Python 2 and 3 in Emacs
In your .emacs file, following should do:
;; python 3
(setq python-python-command "python3")
All I had to do was add
(setq py-python-command "/usr/bin/python3.1")
To my .emacs file.
There are actually a number of different variables that need to be changed if you want to "globally" change the version of Python that is being used in python-mode. Try the following:
(add-hook 'python-mode-hook
(lambda ()
(setq py-python-command "/usr/bin/python3.1")
(setq py-default-interpreter "/usr/bin/python3.1")))
精彩评论