Comment 2 for bug 1783019

Revision history for this message
Halibut Hippo (halibuth) wrote :

site.py performs the following test in getsitepackages() :

       if sys.platform in ('os2emx', 'riscos'):
            sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
        elif _POSIX_BUILD:
            sitepackages.append(os.path.join(prefix, "lib",
                                        "python" + sys.version[:3],
                                        "site-packages"))
            sitepackages.append(os.path.join(prefix, "lib", "site-python"))
        else:
            sitepackages.append(prefix)
            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))

If _POSIX_BUILD is defined, then site-packages would be correctly added to the known_paths list, and lxml could be located where it initially is in the installed system. However, this path is not actually searched, so the implication is that _POSIX_BUILD is not defined. The prefix path is searched, and the 'lib/site-packages' path is not searched - it does not exist and will not be added to known_paths, which is consistent with _POSIX_BUILD not being defined. This kind of makes sense for a Windows build, but I'm not a python expert.

So the root cause of this problem may be an assumption of POSIX behaviour. Unless one of the several other mechanisms for path adjustment is used to add 'site-packages', lxml will not be found. However, I'm a bit uncomfortable about this, because this theory would also mean that all the other packages in site-packages ( such as numpy ) were also inaccessible. Surely Inkscape - or some extensions - must use numpy somewhere ?