Installing Python2.6 on Mac Os (Leopard)

M

Massi

Hi everyone, I'm trying to install Python2.6 on my mac (Leopard
10.5.5), but I'm encountering some problems. To install the package I
followed the instructions I found at this link:
http://wiki.python.org/moin/MacPython/Leopard
If I open wing, it turns out that the installed version is actually
2.6, but if i run python from terminal it displays version 2.5.1, that
is the default version for leopard. Furthermore I can't launch idle.
I'm pretty new to mac os environment so forgive me if my questions are
silly. Any hint?
 
P

Philip Semanchuk

Hi everyone, I'm trying to install Python2.6 on my mac (Leopard
10.5.5), but I'm encountering some problems. To install the package I
followed the instructions I found at this link:
http://wiki.python.org/moin/MacPython/Leopard
If I open wing, it turns out that the installed version is actually
2.6, but if i run python from terminal it displays version 2.5.1, that
is the default version for leopard. Furthermore I can't launch idle.
I'm pretty new to mac os environment so forgive me if my questions are
silly. Any hint?

Your terminal is using the shell environment -- specifically the PATH
-- to find Python. Although your Python is probably installed in a
Framework directory, one doesn't typically put Framework directories
in the PATH. Instead, your install may have created symlinks in /usr/
bin or /usr/local/bin to your Python 2.6 install. If, for instance,
those symlinks live in /usr/local/bin, then put that directory first
in your path and then typing `python` at the command line will launch
Python 2.6.

If the symlinks aren't there, you can create them by hand.

HTH
Philip
 
T

Tommy Nordgren

17 nov 2008 kl. 16.53 skrev Massi:
Hi everyone, I'm trying to install Python2.6 on my mac (Leopard
10.5.5), but I'm encountering some problems. To install the package I
followed the instructions I found at this link:
http://wiki.python.org/moin/MacPython/Leopard
If I open wing, it turns out that the installed version is actually
2.6, but if i run python from terminal it displays version 2.5.1, that
is the default version for leopard. Furthermore I can't launch idle.
I'm pretty new to mac os environment so forgive me if my questions are
silly. Any hint?
Locally build software usually ends up in subdirectories of /usr/local.
The build in Python 2.5 has a symlink installed in /usr/bin.
To make your locally-build python first in the search paths,
add export PATH="/usr/local/bin:$PATH"
to your bash login file
 
D

Diez B. Roggisch

Philip said:
Your terminal is using the shell environment -- specifically the PATH
-- to find Python. Although your Python is probably installed in a
Framework directory, one doesn't typically put Framework directories
in the PATH. Instead, your install may have created symlinks in /usr/
bin or /usr/local/bin to your Python 2.6 install. If, for instance,
those symlinks live in /usr/local/bin, then put that directory first
in your path and then typing `python` at the command line will launch
Python 2.6.

AFAIK there are no symlinks at all created, everything resides
under /Library/Framework/Python.framework/Versions/2.6/bin.

A note to the OP: be cautious about replacing /usr/bin/python with your new
& shiny 2.6! That is likely to break the system, as OSX
uses /usr/bin/python and expects it to be the standard version shipped.

Creating

/usr/bin/python2.6

should be safe though.

Diez
 
P

Philip Semanchuk

AFAIK there are no symlinks at all created, everything resides
under /Library/Framework/Python.framework/Versions/2.6/bin.

Sorry if I misinformed; I have such symlinks in /usr/local/bin dated
the same day as my custom Python install. I guess I could have created
them myself, but I don't think I would have bothered creating a
symlink for pythonw, for example since I never use it.

A note to the OP: be cautious about replacing /usr/bin/python with
your new
& shiny 2.6! That is likely to break the system, as OSX
uses /usr/bin/python and expects it to be the standard version
shipped.

Creating

/usr/bin/python2.6

should be safe though.

Good point, once again I'm sorry for my sloppy information.

bye
Philip
 
D

Diez B. Roggisch

Sorry if I misinformed; I have such symlinks in /usr/local/bin dated
the same day as my custom Python install. I guess I could have created
them myself, but I don't think I would have bothered creating a
symlink for pythonw, for example since I never use it.

Did you really create a framework-install? Maybe that explains it. You can
compile it witout framework on OSX, but then of course miss a lot of
features.

I for once have created PATH-entries to the frameworks in my .bashrc

Diez
 
P

Philip Semanchuk

Did you really create a framework-install? Maybe that explains it.
You can
compile it witout framework on OSX, but then of course miss a lot of
features.

I have two pythons installed, the OS X standard one in the Frameworks
directory under /System, and mine in the Frameworks directory under /
Library. I'm pretty sure I used the --enable-framework option to
install the latter. I can't figure out how else my custom Python would
have landed in a Frameworks directory. =)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top