Is /usr/bin/python still pointing at original Apple Python 2.3 version?

What versions of Python are under /System/Library/Frameworks/Python.framework?

What versions of Python are under /Library/Frameworks/Python.framekwork?

Do you have Python installed in any other locations, eg. from fink or
MacPorts Python under /opt?

Graham

2010/1/22 fhuddles <[email protected]>:
> Well, I tried moving the frameworks 3.0 directory away from the /
> Library/Frameworks: it made no difference.
> I also noticed that there is another installation of python2.6 on my
> computer, evidently installed via Fink. Here's what I've got in the
> Fink-loaded bin directory (/sw/bin):
> ls -l /sw/bin/python*
> lrwxr-xr-x   1 root  admin        9 May  5  2009 /sw/bin/python ->
> python2.6
> lrwxr-xr-x   1 root  admin       16 May  5  2009 /sw/bin/python-config
> -> python2.6-config
> -rwxr-xr-x   1 root  admin  3423412 Nov 13  2008 /sw/bin/python2.4
> -rwxr-xr-x   1 root  admin  3913784 May  6  2009 /sw/bin/python2.5
> -rwxr-xr-x   1 root  admin     1417 May  6  2009 /sw/bin/python2.5-
> config
> -rwxr-xr-x   1 root  admin     9816 May  5  2009 /sw/bin/python2.6
> -rwxr-xr-x   1 root  admin     1364 May  5  2009 /sw/bin/python2.6-
> config
>
> I tried moving them all to a holding directory (/sw/hold/bin): no
> difference. Same errors in the Apache log file.
> Maybe it (Apache/wsgi?) is getting confused between the pythons I've
> loaded via Fink and the one(s) I loaded via MacPython, which is (I
> think) just the 2.6 version. I think
> I loaded 3.0 independently, but I don't remember how I installed that
> one now.
> There's also this, in /usr/lib:
>  ls -ld /usr/lib/py*
> lrwxr-xr-x   1 root  wheel  75 Apr  4  1976 /usr/lib/python2.3 -
>> ../../System/Library/Frameworks/Python.framework/Versions/2.3/lib/
> python2.3
> Checking /System/Llibrary/Frameworks, etc. I get this:
> ls -l /System/Library/Frameworks/Python.framework/Versions
> total 8
> drwxr-xr-x   10 root  wheel  340 Dec 11 18:42 2.3
> lrwxr-xr-x    1 root  wheel    3 Apr  4  1976 Current -> 2.3
>
> So this is a completely parallel and different Python framework. Seems
> I've got a messed-up set of python distributions on my system. Perhaps
> this is confusing Apache/wsgi. It's certainly confusing me!
> I tried moving that /System/Library/Frameworks/Python.framework
> directory out of the way, to /usr/local/apps/hold/. Stopped and
> restarted apache2. No difference.
> Do you have anything to suggest? A Python cleanup, perhaps?
>
> Thanks...
>
>
> On Jan 20, 11:11 pm, fhuddles <[email protected]> wrote:
>> On Jan 20, 5:15 pm, Graham Dumpleton <[email protected]>
>> wrote:
>>
>>
>>
>> > 2010/1/21 fhuddles <[email protected]>:
>>
>> > > On Jan 19, 8:07 pm, Graham Dumpleton <[email protected]>
>> > > wrote:
>> > >> If you add in the hello world WSGI script file at global scope, ie.,
>> > >> outside of application function:
>>
>> > >>   import sys
>> > >>   import socket
>>
>> > >> does it still work?
>> > > No (!). It gives me the same error as the Django app does.
>>
>> > >> Post the portions of Apache configuration you are using to setup WSGI
>> > >> application?
>>
>> > > While we have been working on this, I managed to port this application
>> > > to another machine, running NetBSD 5.0
>> > > and Apache/2.2.9 (Unix) mod_ruby/1.2.6 Ruby/1.8.6(2008-03-03) mod_ssl/
>> > > 2.2.9 OpenSSL/0.9.8e DAV/2 mod_wsgi/2.5 Python/2.6.2 PHP/5.2.6
>>
>> > If you type:
>>
>> >   which python
>>
>> > what do you get and if 'python' at that location is a symlink, what
>> > does the symlink point at?
>>
>> ls -l `which python`
>> lrwxr-xr-x   1 root  admin  9 Nov 26 19:56 /Library/Frameworks/
>> Python.framework/Versions/2.6/bin/python -> python2.6
>>
>> > Can you try it with mod_ruby and PHP disabled to ensure there is no
>> > conflict with those other Apache modules?
>>
>> OK, I disabled PHP5: the mod_ruby is not on the Mac: it's on the
>> NetBSD computer, where WSGI/Django is working.
>> Disabling PHP5 did not improve things.
>>
>> > Do you have DYLD_LIBRARY_PATH environment variable set in your normal
>> > user environment?
>>
>> No:
>> echo $DYLD_LIBRARY_PATH
>> tcsh: DYLD_LIBRARY_PATH: Undefined variable.
>>
>>  Normally you wouldn't, but just want to make sure> you have no odd 
>> environment variable settings to have Python command
>> > line work, as those wouldn't be inherited by Apache/mod_wsgi.
>>
>> > Graham
>>
>> How about if I remove (or rename) the Python3.0 framework: /Library/
>> Frameworks/Python.framework/Versions/3.0
>> I think it used to be the default before I installed 2.6.
>>
>> Regards,
>>
>> Frank H.
>>
>>
>>
>>
>>
>> > > So I made some modifications to the way I have the apps set up on my
>> > > PPC Apple PowerBook, more or less duplicating the successful setup of
>> > > the NetBSD machine.
>> > > The results are the same as before, so I'll give you my current
>> > > configuration, even though it's not exactly the same as when I first
>> > > posted. There may be some unnecessary things, but here are the Apache
>> > > settings:
>>
>> > > WSGIScriptAlias /helloworld /usr/local/apps/test//helloworld.wsgi
>> > > WSGIScriptAlias /djvocab /usr/local/apps/djvocab/apache/django.wsgi
>>
>> > > <Directory /usr/local/apps/djvocab/apache>
>> > >  Order deny,allow
>> > >  Allow from all
>> > > </Directory>
>>
>> > > <Directory /usr/local/apps/djvocab>
>> > >  Order deny,allow
>> > >  Allow from all
>> > > </Directory>
>>
>> > >> If not doing so already, try setting:
>>
>> > >>   WSGIApplicationGroup %{GLOBAL}
>>
>> > >> and try Django again.
>>
>> > > I'm not sure where I should set that.
>>
>> > >> For good measure, send output of:
>>
>> > >>   file .libs/mod_wsgi.so
>> > > file /sw/lib/apache2/modules/mod_wsgi.so
>> > > /sw/lib/apache2/modules/mod_wsgi.so: Mach-O bundle ppc
>>
>> > >> and indicate whether you are on a 64 bit PPC machine.
>> > > You've got me here:  I'm not sure, but I think the G4 PPC is a 32-bit
>> > > processor. WikiPedia says the G4 was 32-bit: the G5 was 64-bit.
>> > > Here's the output of uname -a:
>> > > Darwin iota.local 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct 10
>> > > 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power Macintosh
>> > > powerpc
>>
>> > >> Graham
>>
>> > >> 2010/1/19 fhuddles <[email protected]>:
>>
>> > >> >> Suggest you do the following.
>>
>> > >> >> 1. Use a simple WSGI hello world program and not your Django instance
>> > >> >> to test. See:
>>
>> > >> >>  http://code.google.com/p/modwsgi/wiki/QuickConfigurationGuide
>>
>> > >> >> 2. Change LogLevel directive in Apache configuration to be:
>>
>> > >> >>   LogLevel info
>>
>> > >> >> 3. Verify that all files/directories under:
>>
>> > >> >>   /Library/Frameworks/Python.framework
>>
>> > >> >> are in fact readable/searchable by others and that they don't have
>> > >> >> restrictive permissions which would prevent the user that Apache runs
>> > >> >> as from reading them.
>>
>> > >> >> Graham
>>
>> > >> > OK, I did that: the "helloworld.wsgi" program runs fine. django.wsgi
>> > >> > still does not.
>> > >> > Here's what the error log looks like for the two, with LogLevel info:
>>
>> > >> > [Tue Jan 19 00:09:10 2010] [notice] Apache/2.2.9 (Unix) PHP/5.2.6
>> > >> > mod_wsgi/3.1 Python/2.6.4 configured -- resuming normal operations
>> > >> > [Tue Jan 19 00:09:10 2010] [info] Server built: May  6 2009 00:48:53
>> > >> > [Tue Jan 19 00:09:10 2010] [info] mod_wsgi (pid=13077): Initializing
>> > >> > Python.
>> > >> > [Tue Jan 19 00:09:10 2010] [info] mod_wsgi (pid=13073): Initializing
>> > >> > Python.
>> > >> > [Tue Jan 19 00:09:10 2010] [info] mod_wsgi (pid=13074): Initializing
>> > >> > Python.
>> > >> > [Tue Jan 19 00:09:10 2010] [info] mod_wsgi (pid=13075): Initializing
>> > >> > Python.
>> > >> > [Tue Jan 19 00:09:10 2010] [info] mod_wsgi (pid=13076): Initializing
>> > >> > Python.
>> > >> > [Tue Jan 19 00:09:12 2010] [info] mod_wsgi (pid=13075): Attach
>> > >> > interpreter ''.
>> > >> > [Tue Jan 19 00:09:12 2010] [info] mod_wsgi (pid=13074): Attach
>> > >> > interpreter ''.
>> > >> > [Tue Jan 19 00:09:12 2010] [info] mod_wsgi (pid=13077): Attach
>> > >> > interpreter ''.
>> > >> > [Tue Jan 19 00:09:12 2010] [info] mod_wsgi (pid=13076): Attach
>> > >> > interpreter ''.
>> > >> > [Tue Jan 19 00:09:12 2010] [info] mod_wsgi (pid=13073): Attach
>> > >> > interpreter ''.
>> > >> > [Tue Jan 19 00:09:25 2010] [info] mod_wsgi (pid=13103): Initializing
>> > >> > Python.
>> > >> > [Tue Jan 19 00:09:25 2010] [info] mod_wsgi (pid=13075): Create
>> > >> > interpreter 'localhost|/helloworld'.
>> > >> > [Tue Jan 19 00:09:25 2010] [info] [client ::1] mod_wsgi (pid=13075,
>> > >> > process='', application='localhost|/helloworld'): Loading WSGI script
>> > >> > '/Users/fhuddles/work/temp/helloworld.wsgi'.
>> > >> > [Tue Jan 19 00:09:25 2010] [info] mod_wsgi (pid=13103): Attach
>> > >> > interpreter ''.
>> > >> > [Tue Jan 19 00:09:37 2010] [info] mod_wsgi (pid=13075): Create
>> > >> > interpreter 'localhost|/djvocab'.
>> > >> > [Tue Jan 19 00:09:37 2010] [info] [client ::1] mod_wsgi (pid=13075,
>> > >> > process='', application='localhost|/djvocab'): Loading WSGI script '/
>> > >> > Users/fhuddles/work/djvocab/apache/django.wsgi'.
>> > >> > Fatal Python error: Interpreter not initialized (version mismatch?)
>> > >> > [Tue Jan 19 00:09:37 2010] [notice] child pid 13075 exit signal Abort
>> > >> > trap (6)
>> > >> > [Tue Jan 19 00:09:37 2010] [info] mod_wsgi (pid=13124): Initializing
>> > >> > Python.
>> > >> > [Tue Jan 19 00:09:37 2010] [info] mod_wsgi (pid=13074): Create
>> > >> > interpreter 'localhost|/djvocab'.
>> > >> > [Tue Jan 19 00:09:37 2010] [info] [client ::1] mod_wsgi (pid=13074,
>> > >> > process='', application='localhost|/djvocab'): Loading WSGI script '/
>> > >> > Users/fhuddles/work/djvocab/apache/django.wsgi'.
>> > >> > Fatal Python error: Interpreter not initialized (version mismatch?)
>> > >> > [Tue Jan 19 00:09:37 2010] [info] mod_wsgi (pid=13124): Attach
>> > >> > interpreter ''.
>> > >> > [Tue Jan 19 00:09:38 2010] [notice] child pid 13074 exit signal Abort
>> > >> > trap (6)
>>
>> > >> > I looked at the permissions in the Framework directories:
>> > >> > /Library/Frameworks/Python.framework: mostly rwxr-xr-x, not less
>> > >> > restrictive
>> > >> > Versions: same
>> > >> > 2.6: same
>> > >> > bin: same
>> > >> > lib: some  rw-rw-r--, for example.
>> > >> > ls -l Resources
>> > >> > total 8
>> > >> > drwxrwxr-x   3 root  admin  102 Nov 26 19:56 English.lproj
>> > >> > -rw-rw-r--   1 root  admin  916 Oct 27 13:50 Info.plist
>> > >> > drwxrwxr-x   3 root  admin  102 Nov 26 19:57 Python.app
>> > >> > any others I should look at: there are a lot, but I figure that gets
>> > >> > the main ones.
>> > >> > Besides, since the helloworld app ran, I figure it's not in the
>> > >> > permissions there.
>> > >> > My app directory (/Users/fhuddles/work/djvocab) has mostly rw-r--r--.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to