[Distutils] pip does not work as expected from a zip

Paul Moore p.f.moore at gmail.com
Thu Sep 12 17:27:53 CEST 2013


On 12 September 2013 15:38, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> The problem seems to be that in at least these two places, pip runs code
> looking like
>
> dist = pkg_resources.get_distribution('XXX')
>
> which of course will not find the setuptools or pip in the .pyz.
>
> Is this behaviour by design? If so, it seems somewhat sub-optimal. If not,
> should I create an issue on the pip tracker?

I'd say yes, raise an issue on the pip tracker. At a minimum, it will
ensure that the issue is discussed and the conclusion recorded.

Personally, I'd say that zipping up pip should work. Whether it's
valid to require people to include dist-info directories in zips, as
Daniel says, I'm not sure - maybe it should be a requirement, but if
so, then the python docs on how to zip up files to make executable
zips should document this (potential) requirement.

Without seeing the surrounding code, I can't say whether the use of
pkg_resources here is valid.
Paul


More information about the Distutils-SIG mailing list