2

我最近安装了 Python 3.1,但 Emacs 仍然使用 2.6.5。我正在使用 Emacs 版本 22.2.1。我不确定要编辑哪些文件以使 Emacs 默认使用 Python 3.1!

我正在使用 python-mode.el 和 pyemacs,如果有帮助的话......

最好的,乔治娜

4

3 回答 3

1

请参阅之前对此的讨论

在您的 .emacs 文件中,应该执行以下操作:

;; python 3
(setq python-python-command "python3")
于 2010-11-29T00:38:36.840 回答
1

我所要做的就是添加

(setq py-python-command "/usr/bin/python3.1")

到我的 .emacs 文件。

于 2010-11-29T15:39:59.097 回答
0

如果要“全局”更改在 python 模式下使用的 Python 版本,实际上需要更改许多不同的变量。尝试以下操作:

(add-hook 'python-mode-hook
            (lambda ()
              (setq py-python-command "/usr/bin/python3.1")
              (setq py-default-interpreter "/usr/bin/python3.1")))
于 2011-09-29T14:40:13.697 回答