Jon, Jim and all the kind souls who tried to straighten me out,

While some things are clearer, I'm still ever more confused the deeper I press into this thicket.

On Mon, 28 Jan 2008, Jon Guyer wrote:


On Jan 28, 2008, at 10:25 PM, Jon Crump wrote:

Ah, thanks very much for the explanation. It seems to me that the best thing to do is to move my site-packages directory into the /System/Library/Frameworks branch and then delete the Python installation in the /Library/Frameworks branch.

Ack! Please don't do that. Everything in /System/ is supplied by Apple and should be left alone. However, if you look, I think you'll find that the site-packages/ directory in /System/Library/Frameworks/Python.framework/ is a symlink to someplace in /Library/ (I don't have Leopard, so I don't know for sure, but on my Tiger install /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages points to /Library/Python/2.3/site-packages). site-packages/ is thus a safe place for you to put things, and Python should do so automatically when you run setup.py (but you have to be sure to run the proper variant of python (see below)).

In in my Leopard install, I too have:
/System/Library/Frameworks/Python.framework//Versions/2.3/lib/python2.3/site-packages pointing to /Library/Python/2.3/site-packages

However, in:
/System/Library/Frameworks/Python.framework//Versions/2.5/lib/python2.5 there is no site-packages directory.

In 2.5, the site-packages directory is at /System/Library/Frameworks/Python.framework//Versions/2.5/Extras/lib/python2.5/site-packages and it does not point anywhere. It's a directory containing site-packages/dateutil/zoneinfo/zoneinfo-2007f.tar.gz (what that's doing there, I'm sure I have no idea.)

Now in /Library/Frameworks/Python.framework//Versions/2.3/lib/python2.3 on the other hand, there is a site-packages that points to /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages which is where I've been keeping all my user installed stuff

OK. In /Library/Python I have:
==========
/Library/Python//2.3:
total 0
drwxrwxr-x  4 root  admin  136 Oct  9 20:56 site-packages

/Library/Python//2.3/site-packages:
total 16
-rw-rw-r--  1 root  admin   75 Oct  9 20:56 Extras.pth
-rw-rw-r--  1 root  admin  119 Oct  9 20:56 README

/Library/Python//2.5:
total 0
drwxrwxr-x  4 root  admin  136 Jan 29 10:14 site-packages

/Library/Python//2.5/site-packages:
total 8
-rw-rw-r--  1 root  admin  119 Oct  9 20:41 README
===========

the Extras.pth is a file that contains only this path: /System/Library/Frameworks/Python.framework/Versions/2.3/Extras/lib/python

Now here's another mystery. This path does not exist. /System/Library/Frameworks/Python.framework/Versions/2.3/Extras turns out to be a pointer to /System/Library/Frameworks/Python.framework/Versions/2.4/Extras which also does not exist.

That's the state of my foobared file system. Now as to what to do about it: What works is as I stated before. If I replace /Library/Python//2.5/site-packages with a pointer to /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages then everything works: imports of user-installed packages work both from the command line and from within a bbedit script; However, If I move the contents of /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages into /Library/Python//2.5/site-packages, then imports from bbedit work, but imports from the command line don't.

You have two options:

1) keep your secondary installation of Python in /Library/ and modify your path according to QA1067, as Jim provided. There's nothing inherently wrong with this. Apple is rather conservative about updating things like Python, so you might well find a time in the future where you'll want a newer one than they provide, but you should *not* mess directly with what they supply. Many aspects of the system may be expecting to find a particular version of Python. I think you'll find that /usr/bin/python will invoke the version in /System/ and /usr/local/bin/python will invoke the version in /Library/. This way you can have both present and actively use the one you want.

2) Move the contents of your /Library/ site-packages/ into wherever /System/'s points. Then you can get rid of your installation in /Library/.

So option 2 isn't straightforward. Somewhere along the way something (me) seems to have foobared the old 2.5 installation. Since my symlink in /Library/Python//2.5/ seems to work, I'm inclined to stick my head in the sand and whistle past the graveyard. But I'm concerned about that /System/Library/Frameworks/Python.framework//Versions/2.5/Extras/lib/python2.5/site-packages/dateutil/ business. That just seems weird to me. I don't recall putting that there. The Leopard is the one that came installed on this new MacBook and I don't think I've (knowingly) messed with it yet at all.

Now this is an ugly can of worms. I congratulate anyone who has actually read this far, and I'll forgive everyone who doesn't want to touch it with a 10 foot pole. As to option 1, I haven't yet tried modifying ~/.MacOSX/environment.plist per QA1067. Maybe that would be the way to go, but I don't know what <key> or <string> to put in there to get bbedit to look in /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages for the user-installed stuff.

I apologize for this epic letter, but if anyone has any help for a poor tyro who is in over his head, I'd be grateful.

thanks and best wishes,
Jon

--
------------------------------------------------------------------
Have a feature request? Not sure the software's working correctly?
If so, please send mail to <[EMAIL PROTECTED]>, not to the list.
List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml>
List archives: <http://www.listsearch.com/BBEditTalk.lasso>
To unsubscribe, send mail to:  <[EMAIL PROTECTED]>

Reply via email to