[Bf-python] sitedirs and Python 2.4

Jonathan Merritt j.merritt at pgrad.unimelb.edu.au
Sun Oct 30 04:11:11 CET 2005


Hi Ken,

Ken Hughes wrote:

> I was looking at a bug report 
> (https://projects.blender.org/tracker/index.php?func=detail&aid=3281&group_id=9&atid=125) 
> which is the second I've seen on the subject of site-packages no 
> longer being included in the path.  I looked into it and apparently 
> Python 2.4 no longer contains the "sitedirs" list.


I have noticed this happening too.  Since you've looked into it, do you 
have any more details on *why* it happens?

AFAICT, the site packages should be set (as you pointed out) by a module 
called "site", which is supposedly imported automatically during 
initialization:
    http://www.python.org/doc/2.4.2/lib/module-site.html

The wierd thing is that when I do an:
    >>> import sys
    >>> print sys.path
from the native Python command-line interpreter, the site-packages 
directories are all present.  However, when I do the same thing from 
within Blender it doesn't include the site-packages!  They still aren't 
present even if I first manually "import site" within Blender, although 
"import site" raises no exceptions.

I'd like to be clear on why there's a difference between the embedded 
Python and the Python command-line interpreter.

Jonathan Merritt.




More information about the Bf-python mailing list