help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: emacs uses an old version of python


From: Xah Lee
Subject: Re: emacs uses an old version of python
Date: Sun, 30 Nov 2008 16:52:01 -0800 (PST)
User-agent: G2/1.0

On Nov 30, 1:51 pm, John Seales <praxbaf...@hotmail.com> wrote:
> GNU emacs 22.1.1
> on an Intel MacBook
>
> I've updated to Python 2.6, but emacs still is using 2.3. This is a problem 
> because I need to use the newer features of the language. Looking in my 
> /usr/bin/ directory, I see that 'python2.3' and 'pythonw2.3' are in there, 
> along with just plain 'python'. Using sudo, I copied 'python2.6' and 
> 'pythonw2.6' into /usr/bin, but still emacs calls the old version. 
> Interestingly, the terminal application correctly uses the new version of 
> python when I run it from there.
>
> I'm guessing I may need to move more files around and/or change my .emacs 
> file. But how?
>

there are several things you can do.

set your shell path var in “.emacs”.
(setenv "PATH" "/Users/xah/bin:/sw/bin:/sw/sbin:/bin:/usr/local/bin:/
sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/opt/local/bin:/Developer/
Tools")

make your the python you want comes in one of the path above first.

Not sure what emacs you are using. Carbon emacs? Aquamacs emacs?
Emacs.app? you built it? Because gui apps not started from the shell
will not inherent your shell env.

Also not sure what emacs package you are using. The python mode? some
other python interactive shell? In general, a package may search
obvious places and find the first one it think is the right python.

Also, don't “copy”, but rather make symlink (aka softlink), e.g. “ln -
s /usr/local/bin/python2.6 /usr/loca/bin/py”.

In general, programs will look for “python”, not python2.6 or any
specific version. (same with perl, etc.)

also, you should not touch anything inside /usr/bin. If you need a
later version of python, perl, etc, install them in your home dir, or /
usr/local/bin, or use Fink to install (/sw/bin) or MacPorts (opt/
bin).

  Xah
∑ http://xahlee.org/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]