Re: [Pythonmac-SIG] Interactive shell

2005-11-23 Thread Henning.Ramm
than one way, but I think the most common is to create a file called 
.profile, and put it in your home directory. Put in this line:

export PATH=$PATH:/usr/local/bin

I'd use '.bashrc' or '.bash_profile', because 'export' is bash syntax -- 
'.profile' should be read by any shell, and tcsh (e.g. default in OSX 10.2) 
doesn't understand that.
BTW this file lives in you home folder (~ = /Users/yourname).

If you don't know how to edit 'invisible' files (file name starting with a dot):
You can see them with 'ls -al' and rename them with 'mv .dotname othername' 
(then open with TextEdit and rename again afterwards).

If you want to check which python you're using, try 'which python'.


Best regards,
Henning Hraban Ramm
Südkurier Medienhaus / MediaPro
Support/Admin/Development Dept.
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Interactive shell

2005-11-23 Thread Chris Barker
I've never been able to figure out when to use .profile vs .bashrc, but 
I thought it had to do with only one of them being run when a subshell 
was started, or something like that.

I do note that on both my OS-X and Linux boxes, /etc/profile sources 
bashrc, and uses bash syntax, so it sure looks like a bash-specific 
config file to me.

-Chris

[EMAIL PROTECTED] wrote:

 I'd use '.bashrc' or '.bash_profile', because 'export' is bash syntax -- 
 '.profile' should be read by any shell, and tcsh (e.g. default in OSX 10.2) 
 doesn't understand that.
 BTW this file lives in you home folder (~ = /Users/yourname).

-- 
Christopher Barker, Ph.D.
Oceanographer

NOAA/ORR/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]
___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Interactive shell

2005-11-22 Thread Abe Mathews
You need to create a link in /usr/bin to python2.4.

If at the prompt you do a
$ ls -lai /usr/bin/python*

You should see files for python, python2.3, and python2.4.  All of these are
links - python2.3 and python2.4 should link back to their respective
framework directories (on my machine, 2.3 is in /System, 2.4 is in
/Library).

What I would do next is to cd to /usr/bin and remove the old python link:
$ cd /usr/bin
$ sudo rm python

Then create a new link to the 2.4 python:
$ sudo ln -s python2.4 python

Now when you type python at the prompt it should bring you to 2.4.

Abe Mathews


On 11/22/05 10:23 AM, Jeremy Conlin [EMAIL PROTECTED] wrote:

 I just installed/upgraded python by using the package from
 
 http://undefined.org/python/MacPython-OSX-2.4.1-1.dmg.
 
 I just want the latest version of python so I can use matplotlib
 (among other things).  However, it doesn't seem that the python I use
 from the terminal is version 2.4.x.  What must I do so that when I
 type python on the command line of the terminal I get version 2.4.x?
 Thanks,
 Jeremy
 ___
 Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
 http://mail.python.org/mailman/listinfo/pythonmac-sig
 


___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Interactive shell

2005-11-22 Thread Jeremy Conlin
This is a much better solution.  Sorry I didn't read the archives first.
Jeremy



On 11/22/05, Chris Barker [EMAIL PROTECTED] wrote:
 Abe Mathews wrote:
  You need to create a link in /usr/bin to python2.4.

 Sorry Abe, but:

 DON'T DO THAT

 There are standard ways to do things that will prevent you from messing
 up your system.

 Rule of thumb: don't mess with anything in /usr or /system. That's
 Apple's job.

 When you add things, if they are are unixy then you'll put them in
 /usr/local (that's what local means, more of less).

 So, the Python you installed probably already put python and python2.4
 in /usr/local/bin. What you need to do is put /usr/local/bin on your
 path. There are are a lot docs on the web about how to do this, and more
 than one way, but I think the most common is to create a file called
 .profile, and put it in your home directory. Put in this line:

 export PATH=$PATH:/usr/local/bin

 If .profile already existed, then just add this line to it

 restart terminal, and, to see if you did it right, type:

 echo $PATH

 And you should get a colon separated list of directories in which the
 shell will look for executables.

 Now when you type:

 python

 on the command line, you'll get the old, Apple supplied python.

 when you type:

 python2.4

 you'll get the new one.

 In addition, I like to put:

 #!/usr/bin/env python2.4

 at the top of scripts to make sure I get the right python.

 If you are quite sure that you want your own stuff to take precedence of
 system stuff, you can change that line to:

 export PATH=/usr/local/bin:$PATH

 That will put /usr/local/bin in the front of the search path, so the
 shell will find the python in there before the system one. IN this case,

 python

 will get you 2.4, and to get the old one, you'll need to type:

 python2.3

 or

 /usr/bin/python

 (by the way, this has been discussed ad nausium on this list in the past)

 -Chris





 --
 Christopher Barker, Ph.D.
 Oceanographer

 NOAA/ORR/HAZMAT (206) 526-6959   voice
 7600 Sand Point Way NE   (206) 526-6329   fax
 Seattle, WA  98115   (206) 526-6317   main reception

 [EMAIL PROTECTED]
 ___
 Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
 http://mail.python.org/mailman/listinfo/pythonmac-sig

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig


Re: [Pythonmac-SIG] Interactive shell

2005-11-22 Thread Ronald Oussoren

On 22-nov-2005, at 17:56, Abe Mathews wrote:

 You need to create a link in /usr/bin to python2.4.

 If at the prompt you do a
 $ ls -lai /usr/bin/python*

 You should see files for python, python2.3, and python2.4.

Not if you installed the official installer DMG, it installs
the interpreter in /usr/local/bin.

 ll of these are
 links - python2.3 and python2.4 should link back to their respective
 framework directories (on my machine, 2.3 is in /System, 2.4 is in
 /Library).

 What I would do next is to cd to /usr/bin and remove the old python  
 link:
 $ cd /usr/bin
 $ sudo rm python

 Then create a new link to the 2.4 python:
 $ sudo ln -s python2.4 python

Don't do this, you're replacing a system component. This might break  
OS functionality (Apple uses Python in the PDF workflow). You should  
add /usr/local/bin to the front of your PATH instead.

 Now when you type python at the prompt it should bring you to 2.4.

 Abe Mathews


 On 11/22/05 10:23 AM, Jeremy Conlin [EMAIL PROTECTED] wrote:

 I just installed/upgraded python by using the package from

 http://undefined.org/python/MacPython-OSX-2.4.1-1.dmg.

 I just want the latest version of python so I can use matplotlib
 (among other things).  However, it doesn't seem that the python I use
 from the terminal is version 2.4.x.  What must I do so that when I
 type python on the command line of the terminal I get version  
 2.4.x?
 Thanks,
 Jeremy
 ___
 Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
 http://mail.python.org/mailman/listinfo/pythonmac-sig



 ___
 Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
 http://mail.python.org/mailman/listinfo/pythonmac-sig

___
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig