On Mon, Mar 03, 2008 at 02:26:38PM +0100, Matthias Klose wrote:

> > The new site.py from python2.4-minimal does not include the Python
> > include paths in /usr/local.
> 
> It does for me (the code is in /etc/python2.4/sitecustomize.py):
> $ python
> Python 2.4.4 (#2, Mar  3 2008, 01:33:03) 
> [GCC 4.2.3 (Debian 4.2.3-2)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import sys
> >>> sys.path
> ['', '/usr/lib/python24.zip', '/usr/lib/python2.4', 
> '/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk', 
> '/usr/lib/python2.4/lib-dynload', '/usr/local/lib/python2.4/site-packages', 
> '/usr/lib/python2.4/site-packages', '/var/lib/python-support/python2.4']

Well, I tested it on another system. /usr/local/lib/python2.4/site-packages
is indeed in sys.path, but nevertheless eggs installed manually into
prefix /usr/local are not found:

  [EMAIL PROTECTED]:~$ python
  Python 2.4.4 (#2, Mar  3 2008, 01:16:37) 
  [GCC 4.2.3 (Debian 4.2.3-2)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  >>> import foobar
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
  ImportError: No module named foobar
  >>> 

The egg for foobar is in /usr/local/lib/python2.4/site-packages, and
/usr/local/lib/python2.4/site-packages/easy-install.pth contains a
reference to that egg. This worked with 2.4.4-7 or when applying the
following patch:

--- site.py.old 2008-03-09 02:07:16.000000000 +0100
+++ site.py     2008-03-09 02:08:08.000000000 +0100
@@ -160,8 +160,9 @@
 
 def addsitepackages(known_paths):
     """Add site-packages (and possibly site-python) to sys.path"""
-    prefixes = [sys.prefix]
+    prefixes = [os.path.join(sys.prefix, "local"), sys.prefix]
     if sys.exec_prefix != sys.prefix:
+        prefixes.append(os.path.join(sys.exec_prefix, "local"))
         prefixes.append(sys.exec_prefix)
     for prefix in prefixes:
         if prefix:

It may be a bug in python-setuptools, though.

 - Sebastian




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to