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.
- 12,686
- 2
- 34
- 56
- 367
- 2
- 10
2 Answers
The variable you want is python-shell-interpreter. You can set it with (setq python-shell-interpreter "/path/to/python")
- 12,686
- 2
- 34
- 56
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-pythonis an interactive autoloaded compiled Lisp function inpython.el.(run-python &optional CMD DEDICATED SHOW)Run an inferior Python process.
Argument
CMDdefaults topython-shell-calculate-commandreturn value. When called interactively withprefix-arg, it allows the user to edit such value and choose whether the interpreter should beDEDICATEDfor the current buffer. When numeric prefix arg is other than 0 or 4 do notSHOW.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-hookaftercomint-mode-hookis run. (Type C-h m in the process buffer for a list of commands.)
- 10,243
- 2
- 29
- 75