$ sudo port installed

does not include python in the list returned, so I assume I am using
the OS version.

$ which python
/usr/bin/python

and,

$ python -c "from distutils.sysconfig import get_python_lib; print
get_python_lib()"
/Library/Python/2.5/site-packages

I have been symlinking into /Library/Python/2.5/site-packages.

I have found the *other* site-packages directory, it is;

/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
site-packages

but there is only a partial django directory in there;

django/conf
django/contrib

Ok, so I have removed MacPorts following the instructions in the FAQ.

I have installed the testhandler and here are the results;

General information

Apache version  Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.7l DAV/2
mod_python/3.3.1 Python/2.5.1
Apache threaded MPM     No (single thread MPM)
Apache forked MPM       Yes, maximum 256 processes
Apache server root      /usr
Apache document root    /Library/WebServer/Documents
Apache error log        /private/var/log/apache2/error_log (view last 100
lines)
Python sys.version      2.5.1 (r251:54863, Oct 5 2007, 21:08:09) [GCC 4.0.1
(Apple Inc. build 5465)]
Python sys.path
/Library/Python/2.5/site-packages/MySQL_python-1.2.2-py2.5-macosx-10.5-
i386.egg
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/
python25.zip
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/
python
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/
lib-dynload
/Library/Python/2.5/site-packages
/Library/Python/2.5/site-packages/PIL
/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/
python/PyObjC
Python interpreter name main_interpreter
mod_python.publisher available  Yes
mod_python.psp available        No

which still works without MacPorts.

And;

$ python
Python 2.5.1 (r251:54863, Oct  5 2007, 21:08:09)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import django.core.handlers.modpython
>>>

Looks like the same Python from the command line as from within
mod_python, and yet the command line interpreter has no problem
finding django.core.handlers.modpython !

Still hoping I can find a way to symlink instead of installing every
svn update :-)

On Dec 5, 1:13 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> BTW, that it is looking in:
>
>   /Library/Python/2.5/site-packages
>
> suggests your mod_python is using MacPorts Python.
>
> Where were you actually symlinking in to?
>
> If you were symlinking into /System/Library/Frameworks/Python/Current/
> lib/site-packages it wouldn't find it as it doesn't look there.
>
> Can you just use the OS version of Python 2.5 on MacOS X 10.5 and not
> the MacPorts version. I have seen someone else having odd problems
> when they tried to install MacPorts 2.5 when the OS already supplied
> 2.5.
>
> Graham
>
> On Dec 5, 11:57 am, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > On Dec 5, 10:29 am, Greig Rapley <[EMAIL PROTECTED]> wrote:
>
> > > Unfortunately that hasn't worked. I even tried chown'ing the entire
> > > tree beneath django-trunk, and the symlink itself, to www:www.  Still
> > > mod_python says that it cannot import django.core.handlers.modpython.
> > > I have gone through your mod_python mptest exercise again and
> > > everything works fine.  Then, I simply run python setup.py install
> > > again, and it all works fine.  Any further ideas ?  Can I try
> > > importing django modules using mptest ?
>
> > Set PythonHandler to mod_python::testhandler and see what sys.path is
> > actually being set to for a request.
>
> > Graham
>
> > > On Dec 3, 9:38 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > Apache generally runs as a special user. This user must have read
> > > > access to those Django modules you have symlinked into the Python site-
> > > > packages directory. Thus if the files are not readable to others, or
> > > > any of the directories from the root right down to where the Django
> > > > software is actually installed are not readable/searchable to others,
> > > > then Python running under Apache will fail in being able to import the
> > > > modules.
>
> > > > Graham
>
> > > > On Dec 4, 5:25 am, Greig Rapley <[EMAIL PROTECTED]> wrote:
>
> > > > > Actually, I have just rerun "python setup.py install" to get my
> > > > > installation working again and noticed the running install_egg_info
> > > > > that happens last.  Might this have something to do with my problems
> > > > > when using a symlink instead ?
>
> > > > > On Dec 3, 6:17 pm, Greig Rapley <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hi,
>
> > > > > > I have django (trunk) installed on MacOSX 10.5 using mod_python and 
> > > > > > it
> > > > > > all works fine when I use python setup.py install to actually 
> > > > > > install
> > > > > > the files retrieved via subversion.  However if I follow the
> > > > > > installation instructions to use a symlink to my SITE-PACKAGES
> > > > > > directory I get the following traceback;
>
> > > > > > Traceback (most recent call last):
>
> > > > > >   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> > > > > > line 1537, in HandlerDispatch
> > > > > >     default=default_handler, arg=req, silent=hlist.silent)
>
> > > > > >   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> > > > > > line 1202, in _process_target
> > > > > >     module = import_module(module_name, path=path)
>
> > > > > >   File "/Library/Python/2.5/site-packages/mod_python/importer.py",
> > > > > > line 304, in import_module
> > > > > >     return __import__(module_name, {}, {}, ['*'])
>
> > > > > > ImportError: No module named django.core.handlers.modpython
>
> > > > > > Now I assume this is a Python path issue but I don't know what 
> > > > > > happens
> > > > > > during "python setup.py install" that means my mod_python importer 
> > > > > > can
> > > > > > find django.core.handler.modpython when it can't find the exact same
> > > > > > file (at the exact same path) after I use a symlink ?
>
> > > > > > Any help would be greatly appreciated.
>
> > > > > > Greig
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to