1

I want to use mac-ports python instead of default Apple. When I exec run-python I get the default python. I could not find any reference under customize-groupand customize-variable.

erikstokes
  • 12,686
  • 2
  • 34
  • 56
Enrico Pirani
  • 367
  • 2
  • 10

2 Answers2

3

The variable you want is python-shell-interpreter. You can set it with (setq python-shell-interpreter "/path/to/python")

erikstokes
  • 12,686
  • 2
  • 34
  • 56
2

Also, if you want to set the Python interpreter on-the-fly, you can do C-u M-x run-python, which will prompt for the interpreter to use:

run-python is an interactive autoloaded compiled Lisp function in python.el.

(run-python &optional CMD DEDICATED SHOW)

Run an inferior Python process.

Argument CMD defaults to python-shell-calculate-command return value. When called interactively with prefix-arg, it allows the user to edit such value and choose whether the interpreter should be DEDICATED for the current buffer. When numeric prefix arg is other than 0 or 4 do not SHOW.

For a given buffer and same values of DEDICATED, if a process is already running for it, it will do nothing. This means that if the current buffer is using a global process, the user is still able to switch it to use a dedicated one.

Runs the hook inferior-python-mode-hook after comint-mode-hook is run. (Type C-h m in the process buffer for a list of commands.)

PythonNut
  • 10,243
  • 2
  • 29
  • 75