all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* emacs uses an old version of python
@ 2008-11-30 21:51 John Seales
  2008-11-30 22:34 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: John Seales @ 2008-11-30 21:51 UTC (permalink / raw
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 848 bytes --]


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.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_safety_112008 

[-- Attachment #2: Type: text/html, Size: 1040 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: emacs uses an old version of python
  2008-11-30 21:51 John Seales
@ 2008-11-30 22:34 ` Peter Dyballa
  2008-12-01  6:00 ` Thierry Volpiatto
       [not found] ` <mailman.1595.1228111500.26697.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Dyballa @ 2008-11-30 22:34 UTC (permalink / raw
  To: John Seales; +Cc: help-gnu-emacs


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







^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: emacs uses an old version of python
       [not found] <mailman.1577.1228082753.26697.help-gnu-emacs@gnu.org>
@ 2008-12-01  0:52 ` Xah Lee
  0 siblings, 0 replies; 5+ messages in thread
From: Xah Lee @ 2008-12-01  0:52 UTC (permalink / raw
  To: help-gnu-emacs

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/^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: emacs uses an old version of python
  2008-11-30 21:51 John Seales
  2008-11-30 22:34 ` Peter Dyballa
@ 2008-12-01  6:00 ` Thierry Volpiatto
       [not found] ` <mailman.1595.1228111500.26697.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 5+ messages in thread
From: Thierry Volpiatto @ 2008-12-01  6:00 UTC (permalink / raw
  To: help-gnu-emacs

John Seales <praxbaffle@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





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: emacs uses an old version of python
       [not found] ` <mailman.1595.1228111500.26697.help-gnu-emacs@gnu.org>
@ 2008-12-01  8:26   ` Richard Riley
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Riley @ 2008-12-01  8:26 UTC (permalink / raw
  To: help-gnu-emacs

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> John Seales <praxbaffle@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 ...

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)
`----



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-12-01  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1577.1228082753.26697.help-gnu-emacs@gnu.org>
2008-12-01  0:52 ` emacs uses an old version of python Xah Lee
2008-11-30 21:51 John Seales
2008-11-30 22:34 ` Peter Dyballa
2008-12-01  6:00 ` Thierry Volpiatto
     [not found] ` <mailman.1595.1228111500.26697.help-gnu-emacs@gnu.org>
2008-12-01  8:26   ` Richard Riley

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.