将emacs jedi设置为默认使用python 3

时间:2015-03-01 18:59:07

标签: python emacs jedi

有没有办法让emacs知道我想使用python3而不是python2?

已经尝试过了

(setq jedi:environment-root "jedi")  ; or any other name you like
(setq jedi:environment-virtualenv
      (append python-environment-virtualenv
              '("--python" "../../usr/bin/python3")))

和emacs一直在说

Debugger entered--Lisp error: (void-variable python-environment-virtualenv)
  (append python-environment-virtualenv (quote ("--python" "/usr/bin/python3")))
  (setq jedi:environment-virtualenv (append python-environment-virtualenv (quote ...)))
  eval-buffer(#<buffer  *load*> nil "/home/abdul/.emacs" nil t)  ; Reading at buffer position$
  load-with-code-conversion("/home/abdul/.emacs" "/home/abdul/.emacs" t t)
  load("~/.emacs" t t)
  #[nil "^H\205\264^@   \306=\203^Q^@\307^H\310Q\2027^@ \311=\2033^@\312\307\313\314#\203#^@\$
  command-line()
  normal-top-level()

1 个答案:

答案 0 :(得分:2)

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

确保/ usr / bin /
中有这个名字“python3” 将它添加到.emacs和M-x eval-buffer。