Mailinglist Archive: opensuse-packaging (23 mails)

< Previous Next >
Re: [opensuse-packaging] 10.1 RC1: bug in %suse_update_desktop_file + about python packages
  • From: Michal Marek <mmarek@xxxxxxx>
  • Date: Fri, 14 Apr 2006 13:44:34 +0200
  • Message-id: <443F8B22.601@xxxxxxx>
Pascal Bleser wrote:
> What just makes me wonder... what's the point of installing Python
> libraries under /usr/local when the default sys.path doesn't include
> that directory ?
>
> $ python
> Python 2.4.2 (#1, Apr 9 2006, 16:08:21)
> [GCC 4.1.0 (SUSE Linux)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>>> import sys
>>>>> print sys.path
> ['', '/usr/lib/python24.zip', '/usr/lib64/python2.4',
> '/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
> '/usr/lib64/python2.4/lib-dynload',
> '/usr/lib64/python2.4/site-packages',
> '/usr/lib64/python2.4/site-packages/Numeric',
> '/usr/lib64/python2.4/site-packages/gtk-2.0']
>
> No /usr/local/lib64/python2.4/site-packages in there...

It will appear in sys.path only only if the directory exists:

# mkdir -p /usr/local/lib64/python2.4/site-packages/
$ python -c 'import sys; print sys.path;'
['', '/usr/lib/python24.zip', '/usr/lib64/python2.4',
'/usr/lib64/python2.4/plat-linux2', '/usr/lib64/python2.4/lib-tk',
'/usr/lib64/python2.4/lib-dynload',
'/usr/lib64/python2.4/site-packages',
'/usr/local/lib64/python2.4/site-packages']
^^^^^^^

To be honest, I don't know why it works this way (my python knowledge is
quite limited), ask jmatejek@xxxxxxx if you have problems with the
current way it works:

* Mon Feb 27 2006 - jmatejek@xxxxxxx
- implemented /usr/local path schemes for bug #149809
- python now recognizes packages in /usr/local/lib/python2.4
- distutils install by default into /usr/local/lib/python2.4/site-packages
- on 64bit systems that is of course lib64


Michal

< Previous Next >
Follow Ups