By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,592 Members | 1,666 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,592 IT Pros & Developers. It's quick & easy.

new to mac OS10

P: n/a
I'm on a mac OS X (10.3.8), and I seem to have accidentally destroyed
the default python installation. How should I put it on? Do I need to
use the unix version? any help would be greatly appreciated.

THN
Jul 19 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
Thomas Nelson wrote:
I'm on a mac OS X (10.3.8), and I seem to have accidentally destroyed
the default python installation. How should I put it on? Do I need to
use the unix version? any help would be greatly appreciated.

THN


Hi Thomas,

I'm using OSX 10.3.8 as well. Just wondering, how did you "destroy" it?
What I am thinking is, it may not be as destroyed as you think it might
have...

cheers
maurice
Jul 19 '05 #2

P: n/a
Maurice LING wrote:

I'm using OSX 10.3.8 as well. Just wondering, how did you "destroy" it?
What I am thinking is, it may not be as destroyed as you think it might
have...

cheers
maurice


I was actually trying to update to the newest python version, and I had
read something saying it would conflict with the old version, so I went
through and deleted all the folders that had "python" in the name =].
clever of me, huh? now I can't make either the new or the old work.
Once again, any help would be terrific.

THN
Jul 19 '05 #3

P: n/a

I was actually trying to update to the newest python version, and I had
read something saying it would conflict with the old version, so I went
through and deleted all the folders that had "python" in the name =].
clever of me, huh? now I can't make either the new or the old work.
Once again, any help would be terrific.

THN


Ok... I am going to assume a few things and will need you to check a few
things... please tell me if my assumptions are wrong...

assumption 1: you are afraid of "python overload' in Mac because you
want the latest version of Python but Apple doesn't seems to maintain
the upgrade of the Apple-installed Python.

assumption 2: you are installing the latest version of Python through Fink.

I need you to check the following things and tell me the results:

1. go to /usr/bin and do a "ls -all python*"

2. check for presence of /System/Library/Framework/Python.framework

3. do a "which python"

4. do a "which pythonw"

5. execute "python"

6. execute "pythonw"

i need to assess the damage done :P

Cheers
Maurice

Jul 19 '05 #4

P: n/a
If you simply want the latest python to run from the command line, then
compiling the source code works fine on the mac. I just installed
2.4.1 on Os 10.3.8 last week without any problems.

http://www.python.org/ftp/python/2.4.1/Python-2.4.1.tgz

"./configure"
"make"
"make install"

J.S.

Jul 19 '05 #5

P: n/a
The main thing I would like is to be able to use tkinter with python on
my mac. will the command-line-style source allow this? Does it come
with IDLE? How is the fink version different from the source i can
download at python.org? Here's the result of the requested commands on
my Terminal. It would appear that these links are broken, as
Python.framework no longer exists. Sorry to be so much trouble,

THN

Welcome to Darwin!
~ $ ls -all /usr/bin/python*
lrwxr-xr-x 1 root wheel 9 20 Jun 2004 /usr/bin/python -> python2.3
lrwxr-xr-x 1 root wheel 72 20 Jun 2004 /usr/bin/python2.3 ->
.../../System/Library/Frameworks/Python.framework/Versions/2.3/bin/python
lrwxr-xr-x 1 root wheel 10 20 Jun 2004 /usr/bin/pythonw -> pythonw2.3
-rwxr-xr-x 1 root wheel 122 8 Jun 2003 /usr/bin/pythonw2.3
~ $ ls /System/Library/Framework/Python.framework
ls: /System/Library/Framework/Python.framework: No such file or directory
~ $ cd /System/Library/Framework/Python.framwork
-bash: cd: /System/Library/Framework/Python.framwork: No such file or
directory
~ $
Jorl Shefner wrote:
If you simply want the latest python to run from the command line, then
compiling the source code works fine on the mac. I just installed
2.4.1 on Os 10.3.8 last week without any problems.

http://www.python.org/ftp/python/2.4.1/Python-2.4.1.tgz

"./configure"
"make"
"make install"

J.S.

Jul 19 '05 #6

P: n/a
Thomas Nelson wrote:
The main thing I would like is to be able to use tkinter with python on
my mac. will the command-line-style source allow this? Does it come
with IDLE?
No. You need a framework version, which can be built from source, but
it's best to leave that to people who know what they're doing. ;-)

http://python.org/ftp/python/2.4.1/M...SX-2.4.1-1.dmg

As for restoring Python 2.3.0, see below before going further. You may
have to reinstall the OS or parts of it. Or you might also be able to
snag the directories from another suitable OS X installation using the
appropriate tools.

And next time, *don't delete system files*!
How is the fink version different from the source i can
download at python.org? Here's the result of the requested commands on
my Terminal. It would appear that these links are broken, as
Python.framework no longer exists. Sorry to be so much trouble,

THN

Welcome to Darwin!
~ $ ls -all /usr/bin/python*
lrwxr-xr-x 1 root wheel 9 20 Jun 2004 /usr/bin/python -> python2.3
lrwxr-xr-x 1 root wheel 72 20 Jun 2004 /usr/bin/python2.3 ->
../../System/Library/Frameworks/Python.framework/Versions/2.3/bin/python
lrwxr-xr-x 1 root wheel 10 20 Jun 2004 /usr/bin/pythonw -> pythonw2.3
-rwxr-xr-x 1 root wheel 122 8 Jun 2003 /usr/bin/pythonw2.3
~ $ ls /System/Library/Framework/Python.framework
ls: /System/Library/Framework/Python.framework: No such file or directory
~ $ cd /System/Library/Framework/Python.framwork
-bash: cd: /System/Library/Framework/Python.framwork: No such file or
directory
~ $


You misspelt the framework path in both cases.

Blasphemy:~ kern$ ls /System/Library/Frameworks/Python.framework/
Headers Python Resources Versions

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Jul 19 '05 #7

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It's *not* a good idea to delete Apple's system Python. You will
probably need to reinstall the OS.

In addition to the mailing list that someone else posted (which is a
great resource!), here's a good site to check out:

http://pythonmac.org/

The site maintainer, Bob Ippolito, is one of the main developers of
Python on the Mac and maintains a lot of packages. This site also
includes lots of links to information.

Hope that helps,
Kevin

Thomas Nelson wrote:
| The main thing I would like is to be able to use tkinter with python on
| my mac. will the command-line-style source allow this? Does it come
| with IDLE? How is the fink version different from the source i can
| download at python.org? Here's the result of the requested commands on
| my Terminal. It would appear that these links are broken, as
| Python.framework no longer exists. Sorry to be so much trouble,
|
| THN
|
|
|
| Welcome to Darwin!
| ~ $ ls -all /usr/bin/python*
| lrwxr-xr-x 1 root wheel 9 20 Jun 2004 /usr/bin/python -> python2.3
| lrwxr-xr-x 1 root wheel 72 20 Jun 2004 /usr/bin/python2.3 ->
| ../../System/Library/Frameworks/Python.framework/Versions/2.3/bin/python
| lrwxr-xr-x 1 root wheel 10 20 Jun 2004 /usr/bin/pythonw -> pythonw2.3
| -rwxr-xr-x 1 root wheel 122 8 Jun 2003 /usr/bin/pythonw2.3
| ~ $ ls /System/Library/Framework/Python.framework
| ls: /System/Library/Framework/Python.framework: No such file or directory
| ~ $ cd /System/Library/Framework/Python.framwork
| -bash: cd: /System/Library/Framework/Python.framwork: No such file or
| directory
| ~ $
|
|
| Jorl Shefner wrote:
|
|> If you simply want the latest python to run from the command line, then
|> compiling the source code works fine on the mac. I just installed
|> 2.4.1 on Os 10.3.8 last week without any problems.
|>
|> http://www.python.org/ftp/python/2.4.1/Python-2.4.1.tgz
|>
|> "./configure"
|> "make"
|> "make install"
|>
|> J.S.
|>
- --
Cheers,

Kevin Walzer, PhD
WordTech Software--Open Source Applications and Packages for OS X
http://www.wordtech-software.com
http://www.smallbizmac.com
http://www.kevin-walzer.com
mailto:sw@wordtech-software.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCYVSkJmdQs+6YVcoRAj2IAJ4/Pv0yJhs4flLOk1JgEHcUbNrJPwCeMeS9
ue7gNcVE8Kluw7LplS1bFGs=
=uqOO
-----END PGP SIGNATURE-----
Jul 19 '05 #8

P: n/a
Hi Thomas,

It seems that you've cleanly killed the Apple-installed Python, which
isn't too bad a thing after all. What I can suggest you do is this...
Copy the entire /System/Library/Frameworks/Python.framework directory
from someone and drop it into your system (same place of course). I will
not suggest installing Python 2.4.1 until the Apple-installed Python is
sorted out. My reasons being,

1. I have no idea what Mac OSX uses Python for. Although symlink may get
you through most of the time but I cannot be sure that none of OSX's
stuffs are hardcoded to use the Python in
/System/Library/Frameworks/Python.framework.

2. Installing another Python may or may not be a precise remedy. It may
just worsen things and I won't want to bet on that.

3. Apple-installed Python's command line tools are symlinked from
/usr/bin to /System/Library/Frameworks/Python.framework but the OSX
installer for Python 2.4.1 places the commandline tools in
/usr/local/bin and symlinked to /Library/Frameworks/Python.framework. So
it seems to me that Python 2.4.1 (installed using OSX installer for
Python 2.4.1) is not a precise replacement of Apple-installed Python...

For me, my setup is this

ls -all /usr/bin/python*
lrwxr-xr-x 1 root wheel 14 4 Apr 08:40 /usr/bin/python ->
/sw/bin/python
lrwxr-xr-x 1 root wheel 72 1 Apr 1976 /usr/bin/python2.3 ->
.../../System/Library/Frameworks/Python.framework/Versions/2.3/bin/python
lrwxr-xr-x 1 root wheel 10 1 Apr 1976 /usr/bin/pythonw -> pythonw2.3
-rwxr-xr-x 1 root wheel 122 9 Jun 2003 /usr/bin/pythonw2.3

/usr/bin/pythonw2.3 and /usr/bin/python2.3 points to the same thing,
/System/Library/Frameworks/Python.framework/Versions/2.3/bin/python. And
I have Fink's Python in /sw/bin/python.

So now, for me, if I need to use the Apple-installed Python, my command
line is "pythonw" while "python" gives me Fink's Python as shown below:

~ mauriceling$ pythonw
Python 2.3 (#1, Sep 13 2003, 00:49:11)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import sys
sys.path ['',
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip',
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3',
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages',
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk',
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload',
'/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages']

~ mauriceling$ python
Python 2.3.5 (#1, Apr 6 2005, 13:01:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1671)] on darwin
Type "help", "copyright", "credits" or "license" for more information. import sys
sys.path ['', '/sw/lib/python23.zip', '/sw/lib/python2.3',
'/sw/lib/python2.3/plat-darwin', '/sw/lib/python2.3/plat-mac',
'/sw/lib/python2.3/plat-mac/lib-scriptpackages',
'/sw/lib/python2.3/lib-tk', '/sw/lib/python2.3/lib-dynload',
'/sw/lib/python2.3/site-packages',
'/sw/lib/python2.3/site-packages/Numeric',
'/sw/lib/python2.3/site-packages/libsbml',
'/sw/lib/python2.3/site-packages/gtk-2.0']


There is no problem with having multiple versions and copies of Pythons
in your system. The problems are:

1. get all the symlinks correct
2. know when to use what and how to use
3. means that you may have to install the same 3rd party library x-times
for x-numbers of Pythons you might have... quite a pain...

Cheers
Maurice
Jul 19 '05 #9

P: n/a
Maurice LING wrote:
Hi Thomas,

It seems that you've cleanly killed the Apple-installed Python, which
isn't too bad a thing after all. What I can suggest you do is this...
Copy the entire /System/Library/Frameworks/Python.framework directory
from someone and drop it into your system (same place of course). I will
not suggest installing Python 2.4.1 until the Apple-installed Python is
sorted out. My reasons being,

1. I have no idea what Mac OSX uses Python for. Although symlink may get
you through most of the time but I cannot be sure that none of OSX's
stuffs are hardcoded to use the Python in
/System/Library/Frameworks/Python.framework.
I believe Apple only uses it for their fax utilities. There's also the
CoreGraphics wrapper (which the fax stuff uses), but that's pretty
useless as it is.
2. Installing another Python may or may not be a precise remedy. It may
just worsen things and I won't want to bet on that.
The 2.4.1 build by Bob Ippolito is designed to work alongside the
system-installed Python. It certainly won't replace it, but it shouldn't
worsen anything.
3. Apple-installed Python's command line tools are symlinked from
/usr/bin to /System/Library/Frameworks/Python.framework but the OSX
installer for Python 2.4.1 places the commandline tools in
/usr/local/bin and symlinked to /Library/Frameworks/Python.framework. So
it seems to me that Python 2.4.1 (installed using OSX installer for
Python 2.4.1) is not a precise replacement of Apple-installed Python...


Bingo. It's not intended to be one.

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Jul 19 '05 #10

P: n/a
Robert Kern wrote:
3. Apple-installed Python's command line tools are symlinked from
/usr/bin to /System/Library/Frameworks/Python.framework but the OSX
installer for Python 2.4.1 places the commandline tools in
/usr/local/bin and symlinked to /Library/Frameworks/Python.framework.
So it seems to me that Python 2.4.1 (installed using OSX installer for
Python 2.4.1) is not a precise replacement of Apple-installed Python...

Bingo. It's not intended to be one.


Hi Robert,

Once I've tried to install Python 2.4.1 through the installer Bob
Ippolito built. I've already for Fink installed Python 2.3.5 in my
system. So,

/usr/bin/python -> /sw/bin/python

and the newly installed Python 2.4.1 created /usr/local/bin/python ->
/Library/Frameworks/Python.framework/python

Does /usr/bin/python takes precedence over /usr/local/bin/python?

Somehow it rings an alarm in me...

Cheers
Maurice
Jul 19 '05 #11

P: n/a
Maurice LING wrote:
Robert Kern wrote:
3. Apple-installed Python's command line tools are symlinked from
/usr/bin to /System/Library/Frameworks/Python.framework but the OSX
installer for Python 2.4.1 places the commandline tools in
/usr/local/bin and symlinked to /Library/Frameworks/Python.framework.
So it seems to me that Python 2.4.1 (installed using OSX installer
for Python 2.4.1) is not a precise replacement of Apple-installed
Python...
Bingo. It's not intended to be one.


Hi Robert,

Once I've tried to install Python 2.4.1 through the installer Bob
Ippolito built. I've already for Fink installed Python 2.3.5 in my
system. So,

/usr/bin/python -> /sw/bin/python


Don't do that. Leave /usr alone! (/usr/local excepted)

Change your PATH environment variable if you want a different Python to
start up when you type

$ python
and the newly installed Python 2.4.1 created /usr/local/bin/python ->
/Library/Frameworks/Python.framework/python

Does /usr/bin/python takes precedence over /usr/local/bin/python?

Somehow it rings an alarm in me...


That depends on your PATH environment variable, and that only affects
the command line in a terminal shell.

Anything that looks for /usr/bin/python should find the link to the
system Python. Anything that just asks for "whatever python comes first
in your PATH" is customizable via the order of directories in your PATH.

--
Robert Kern
rk***@ucsd.edu

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter

Jul 19 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.