Q:

package doesn't find zlib in buildroot

I am adding support for host-setuptools in an older version of buildroot. This seems to need zlib to install host-setuptools.  I can see that zlib and host-zlib are built before setuptools during a make however I am still getting an error saying it can't be found (seems I have zlib but the python file isn't finding it):
  z = zipfile.ZipFile(zip_filename, mode, compression=compression)
  File "/media/vmpart/svn_snmp_x86/buildroot/output/host/usr/lib/python2.7/zipfile.py", line 679, in __init__
    "Compression requires the (missing) zlib module"
RuntimeError: Compression requires the (missing) zlib module
make: *** [/media/vmpart/svn_snmp_x86/buildroot/output/build/host-setuptools-20.3.1/.stamp_host_installed] Error 1

Any ideas?
Here is the make file:
#############################################################
#
# setuptools
#
#############################################################

SETUPTOOLS_VERSION = 20.3.1
SETUPTOOLS_SOURCE  = setuptools-$(SETUPTOOLS_VERSION).tar.gz
SETUPTOOLS_SITE    = https://pypi.python.org/pypi/setuptools
HOST_SETUPTOOLS_DEPENDENCIES =  python zlib host-zlib

define HOST_SETUPTOOLS_BUILD_CMDS
    (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
endef

define HOST_SETUPTOOLS_INSTALL_CMDS
   (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
endef

define HOST_SETUPTOOLS_UNINSTALL_TARGET_CMDS
    $(MAKE1) -C $(@D) uninstall
endef

$(eval $(call GENTARGETS,package,setuptools))
$(eval $(call GENTARGETS,package,setuptools,host))

Python make file: http://pastebin.com/ZttjC7sV

A:

The problem is not about whether you have zlib or host-zlib enabled/built, but whether your host-python was built with zlib support or not.
Since you aren't saying which version of Buildroot you're using, there's no way to give more hints unfortunately, since I can't look at how we were packaging/building Python at the time.
Also, please upgrade: we have host-python-setuptools in Buildroot since quite a long time now. And by upgrading, you will benefit from numerous other Buildroot improvements.
Rather than spending/investing time or money in backporting features, you should really think of spending that same amount of time/money in upgrading to a newer release.

