Im new to Emacs, i hope i didn't miss anything simple.

My configuration is:

  • OS - OSX sierra 10.12.6.
  • Emacs - 25.3.1 (Emacs-emacs-plus from homebrew)
  • python - trying to set 2.7.14.

I want to make myself a decent developing environment for python, there is one problem i'm not sure how to solve.

I want emacs (and all layers) to use python from this path: /usr/local/bin/python2

I seted in .spacemacs file at (defun dotspacemacs/user-config ():

    ;; python:
    (setq python-shell-interpreter "/usr/local/bin/python2")
    (setq py-python-command "/usr/local/bin/python2")
    (setq python-shell-completion-native-enable nil)

Now when i execute run-python: python path run-pyton. it works well and start with desired version.

But when i'm editing python file in python-mode and trying to launch either live-py or python-execute-file it opens up in system default python version. i.e.: py-live mode. different path.

What i am doing wrong?


  • What's python-execute-file? I don't seem to have a command with that name (spacemacs branch devel). Commented Nov 11, 2017 at 22:12

2 Answers 2


SPC h d f run-python RET and SPC h d f live-py-mode will tell you that those two commands are provided by different files (python.el and live-py-mode.el respectively). This will take you to the source code for live-py-mode: SPC SPC find-library RET live-py-mode RET. If you look at the variables near the top of that file, you'll see that setting live-py-mode like this is what you need:

(setq live-py-version "python2")

  • trying SPC h d f live-py-mode RET i keep getting this message: simpler-helm-bookmark-keybindings: Symbol’s value as variable is void: helm-bookmark-map @Croad Langshan Commented Nov 14, 2017 at 7:06
  • @MasterSprinkler Looks like you might need to update your spacemacs: github.com/syl20bnr/spacemacs/issues/9549
    – Ryan
    Commented Mar 12, 2018 at 16:55

I also had the same problem. Then I figured it out that I can use C-u SPC m c c, and then, for example, using python3 python_script.py to execute python_script.py with specified python3 rather than the system default python. However, I still don't know how to set the default version as python3.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.