py-python-命令被忽略
我在 OS X 上使用 python-mode 6.0.1,emacs 23.3 (http://emacsformacosx.com/版本)。
我试图让 Cc Cc
默认为 python 3。
我的 .emacs 中有以下内容:
(setq py-python-command "/usr/local/bin/python3")
当我运行 Ch b py-python-command 时,它告诉我该值是(正确)。
但是,运行 Cc Cc
仍会打开 2.7.2。
我还尝试添加:
(setq py-which-shell "/usr/local/bin/python3")
按照此处的建议: Python 2 和 3在 Emacs 中,但这不会改变任何东西(py-which-shell 确实发生了改变,但它仍然启动 2.7.2)。
有什么想法吗?
I'm using python-mode 6.0.1 on OS X, emacs 23.3 (http://emacsformacosx.com/ version).
I'm trying to get C-c C-c
to default to python 3.
I have the following in my .emacs:
(setq py-python-command "/usr/local/bin/python3")
And when I run C-h b py-python-command, it tells me the value is that (correctly).
However, running C-c C-c
still opens 2.7.2.
I also tried adding:
(setq py-which-shell "/usr/local/bin/python3")
as suggested here: Both Python 2 and 3 in Emacs, but that doesn't change anything (py-which-shell does get changed, but it still launches 2.7.2).
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试将以下代码添加到您的 Emacs 初始化文件中:
Try adding the following code to your Emacs init file:
py-default-interpreter 目前只是一个别名,是为了向后兼容而提供的。
您可能遇到了错误。
请提交一份报告,并在以下位置提供一些示例代码:
https://bugs.launchpad.net/python-mode
缓冲区代码是否包含指定的 shebang pythonVERSION ,这优先于默认设置。
您可以通过调用特定的 pythonVERSION 来强制执行缓冲区
类 py-execute-buffer-pythonVERSION 的命令
请参阅菜单 PyExec,条目执行缓冲区 ...
py-default-interpreter for now is an alias only, delivered for backward compatibility
You might have encountered a bug.
Please file a report giving some example code at
https://bugs.launchpad.net/python-mode
Should the buffer code contain a shebang specifying pythonVERSION , than this takes precedence over default setting.
You may enforce executing buffer through specific pythonVERSION by calling
a command of class py-execute-buffer-pythonVERSION
See menu PyExec, entry Execute buffer ...