debian/Ubuntu Python packages are, imho, a confusing mess. There is .pth files that change the paths, stuff like /usr/share/pyshared, multiple different places where Python libraries can be placed, and as a result, more often than not, Python fails to find some includes.
Python packages, when installed on a debian/Ubuntu system, perform some postinstall scripts which is why simply unpacking them might leave us with unresolved paths. We would need to run the equivalent of them when we unpack python-* deb packages.
update-alternatives: using /usr/lib/wx/python/wx2.8.pth to provide /usr/lib/wx/python/wx.pth (wx.pth) in auto mode
Or, for python-numpy, there is the following postinstall script inside the package that calls update-python-modules:
# Automatically added by dh_pysupport
if which update-python-modules >/dev/null 2>&1; then
# End automatically added section
As a result, simply unpacking the numpy package is not sufficient.
This is quite black magic to me; help would be greatly appreciated.
Only halfway related, on a debian/Ubuntu system, there is a file /var/lib/dpkg/info/python-minimal.postinst. It calls
python2.7 -m compileall /usr/share/python/ >/dev/null
This compiles a whole directory tree from py to pyc. Maybe we should run that, too.