Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

emacs uses an old version of python

4 views
Skip to first unread message

John Seales

unread,
Nov 30, 2008, 4:51:01 PM11/30/08
to help-gn...@gnu.org
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?

John Seales


Color coding for safety: Windows Live Hotmail alerts you to suspicious email. Sign up today.

Peter Dyballa

unread,
Nov 30, 2008, 5:34:26 PM11/30/08
to John Seales, help-gn...@gnu.org

Am 30.11.2008 um 22:51 schrieb John Seales:

> I've updated to Python 2.6

I don't know how you did (Apple does not provide any updates in form
of install package) – when I updated on Tiger to Python 2.5 I had the
binaries in /usr/local/bin. And also in /Library/Frameworks/
Python.framework/Versions/Current/bin. Just adjust PATH resp. path
system-wide if you are using Emacs as client of some windowing
system, or for your shell environment if you're using non-windowing
Emacs. You can also read http://developer.apple.com/qa/qa2001/
qa1067.html. (Property List Editor can be found in /Developer/
Applications/Utilities in case you have installed the developer meta-
package, otherwise you would need to use the defaults command from
the command line.)

Some details are explained in the manual entries of tcsh and bash,
whatever shell you use.

--
Greetings

Pete

I love deadlines. I love the whooshing noise they make as they go by.
– Douglas Adams

Xah Lee

unread,
Nov 30, 2008, 7:52:01 PM11/30/08
to
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/


Thierry Volpiatto

unread,
Dec 1, 2008, 1:00:00 AM12/1/08
to help-gn...@gnu.org
John Seales <praxb...@hotmail.com> writes:

> 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?

Hi!
with python-mode i use:

,----[ C-h v py-python-command RET ]
| py-python-command is a variable defined in `python-mode.el'.
| Its value is "ipython"
|
| Documentation:
| *Shell command used to start Python interpreter.
|
| You can customize this variable.
|
| ===*===*===*===*===*===*===*===*===*===*===
`----

for me it's ipython but it can be python2.5 or 6 ...

--
A + Thierry Volpiatto
Location: Saint-Cyr-Sur-Mer - France

Richard Riley

unread,
Dec 1, 2008, 3:26:33 AM12/1/08
to
Thierry Volpiatto <thierry....@gmail.com> writes:

Alternatively leave it as python and have this in your ~/.python.py

,----
| import IPython,os
|
| if os.path.isfile('.pythonrc.py'):
| execfile('.pythonrc.py')
|
| IPython.Shell.IPShell().mainloop(sys_exit=1)
`----

0 new messages