Trying to change the version of python emacs uses. (OSX10.6)
In Terminal python brings up the version I've set up in PATH But in EMACS it does not.
How can I change this?
To change the default version on a MacOS, we can begin by downloading the newest installer from the Python downloads page (https://www.python.org/downloads/mac-osx/). Downloading the installer will insert the new version into /usr/local/bin.
Another option is to look into fixing the environment variable PATH for Emacs which is a little tricky when using Emacs on Mac OS. Just make sure that Emacs' PATH has the same value as PATH in Terminal.app/Bash. These links should help:
Accessing OS X / UNIX environment variables in Emacs minibuffer
http://www.emacswiki.org/emacs/EmacsApp
(cf. Section "Path" and "Alternative Path Solution")
The easiest way (assuming you are running the GUI version of Emacs), is to choose
Options->Customize Emacs->Specific Option
and type python-python-command, and fill in the path to the python you want. Then save for future sessions and you should be good.
I'm really not sure why it wouldn't be honoring the path variable. The default should be simply "python" (no path). Maybe you have already set this, or you are changing the command path in your .emacs? You could look in ~/.emacs and see if you are doing either of those.
try to add this to your .emacs or other config file:
(setq python-version-checked t)
(setq python-python-command "python2.7")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With