Bugzilla – Bug 149809
python path does not contain /usr/local
Last modified: 2006-02-28 16:57:28 UTC
On my SuSE 10.0 x86_64 box, the python paths are as follows: # 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/lib64/python2.4/site-packages/Numeric', '/usr/lib64/python2.4/site-packages/PIL', '/usr/lib64/python2.4/site-packages/setuptools-0.6a9-py2.4.egg', '/usr/lib64/python2.4/site-packages/gtk-2.0', '/usr/lib64/python2.4/site-packages/wx-2.6-gtk2-unicode'] # Note the lack of anything that starts with /usr/local. At the very least, /usr/local/lib64/python2.4/site-packages/ should be in that list, for the same reasons that $PATH contains /usr/local/bin $XDG_CONFIG_DIRS contains /usr/local/etc/xdg/. Among other reasons, /usr may be marked read-only, as per the FHS. I'm sure this applies to 10.1 as well.
At first, I thought this was a Python bug. http://sourceforge.net/tracker/?group_id=5470&atid=105470&func=detail&aid=1428789 The response from the Python devs led me to post it here. Apparently by default Python already contains /usr/local in its path, and--equally important--distutils also supports /usr/local. (see Python dev response above)
Fair enough, and they also mentioned ways to implement the desired behaviour. I'll start working on it ASAP. (just on a side note: the python defaults actually do not support this behaviour as they are, it's a side effect of the default configuration. Fortunately, python makes it easy to implement.)
*** Bug 149843 has been marked as a duplicate of this bug. ***
fixed in Python and updated all modules (hopefully) Note that for sys.path to contain /usr/local/whatever, the directories must exist. That is the standard Python logic.
(In reply to comment #4) > fixed in Python and updated all modules (hopefully) Awesome! Thanks Jan Matejek. =) > Note that for sys.path to contain /usr/local/whatever, the directories must > exist. That is the standard Python logic. Right, yes, I remember reading that part of the Python doc. I just wanted to confirm that /usr/local/lib64 will be in the next x86_64 SuSE release, as /usr/local/lib64 is guaranteed to exist. $ rpm -qf /usr/local/lib64 filesystem-10.0-4.2 $ I presume /usr/local/lib is guaranteed to exist on x86 SuSE releases.
> I just wanted to confirm that /usr/local/lib64 will be in the next x86_64 SuSE > release, as /usr/local/lib64 is guaranteed to exist. > I presume /usr/local/lib is guaranteed to exist on x86 SuSE releases. that's right, and both mentioned directories will be there