I have now looked at the code for site.getsitepackages() at https://github.com/python/cpython/blob/master/Lib/site.py#L319 and it seems no better than what's in paths.py.in, so I'm not sure this will be effective unless your distro hacks site.py. Is that the case?
It appears Ubuntu does hack site.getsitepackages() to actually return ['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages'].
I am reluctant to do anything without a better understanding of what site.getsitepackages() returns in various distros.
I have now looked at the code for site.getsitepac kages() at https:/ /github. com/python/ cpython/ blob/master/ Lib/site. py#L319 and it seems no better than what's in paths.py.in, so I'm not sure this will be effective unless your distro hacks site.py. Is that the case?
It appears Ubuntu does hack site.getsitepac kages() to actually return ['/usr/ local/lib/ python2. 7/dist- packages' , '/usr/lib/ python2. 7/dist- packages' ].
I am reluctant to do anything without a better understanding of what site.getsitepac kages() returns in various distros.