Python 3.x 将emacs python模式解释器更改为python3.5

Python 3.x 将emacs python模式解释器更改为python3.5,python-3.x,emacs,Python 3.x,Emacs,我已经尝试过了,但没有成功,在这两种情况下,当我C-C-p我仍然得到python2.7..您必须更改emacs在命令中使用的python解释器 (setq python-shell-interpreter "python3") 您应该将其设置为所需的任何命令。它也可以是ipython,在这种情况下,您需要 (setq python-shell-interpreter "ipython" python-shell-interpreter-args "-i") 在ipython命令调

我已经尝试过了,但没有成功,在这两种情况下,当我
C-C-p
我仍然得到python2.7..

您必须更改emacs在命令中使用的python解释器

(setq python-shell-interpreter "python3")
您应该将其设置为所需的任何命令。它也可以是ipython,在这种情况下,您需要

(setq python-shell-interpreter "ipython"
      python-shell-interpreter-args "-i")

ipython
命令调用python 3.5版本的ipython

时,上述解决方案对我不起作用。我们所做的工作是:

(setq py shell名称“python3”)

根据python-mode.el中的py choose shell,它通过以下方法选择shell:

这样做的目的如下:

  • 寻找具有“py choose shell by shebang”的解释器
  • 使用“py--按导入选择shell”检查导入
  • 查看Path/To/File是否表示Python版本
  • 如果不成功,则返回默认值“py shell name”