As discussed in Distutils-SIG. Here's a patch for site.py that adds: - getsitepackages : Returns a list containing all global site-packages directories (and possibly site-python). - getusersitepackages: Returns the user-specific site-packages directory path. - getuserbase: Returns the `user base` directory path.
Two things: * The globals should get a comment explaining what their purpose is and where they are being initialized. * The get*() functions should only initialize the globals if they are set to None. In the patch, they are initialized every time the functions are called.