On 06-Sep-2016, Ben Finney wrote: > I have manually installed older versions of ‘python-pkg-resources’ > into a clean chroot, and confirmed that this behaviour happens […]
Note that the problem does *not* occur when running the same statement at an interactive Python prompt: ===== $ python2 Python 2.7.12+ (default, Aug 4 2016, 20:04:34) [GCC 6.1.1 20160724] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from pkg_resources import load_entry_point >>> ===== This behaviour is only when the generated script is run: ===== $ dpkg-query --show python-pkg-resources python-pkg-resources 20.7.0-1 $ head -n 7 /usr/bin/dput #!/usr/bin/python # EASY-INSTALL-ENTRY-SCRIPT: 'dput==0.10.3','console_scripts','execute-dput' __requires__ = 'dput==0.10.3' import re import sys from pkg_resources import load_entry_point $ /usr/bin/dput Traceback (most recent call last): File "/usr/bin/dput", line 6, in <module> from pkg_resources import load_entry_point File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2927, in <module> @_call_aside […] File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 829, in resolve raise DistributionNotFound(req, requirers) pkg_resources.DistributionNotFound: The 'setuptools' distribution was not found and is required by dput ===== So a statement that works in a fresh Python interpreter, fails when the same statement is executed by the same interpreter, early in the command-line script. -- \ “If the desire to kill and the opportunity to kill came always | `\ together, who would escape hanging?” —Mark Twain, _Following | _o__) the Equator_ | Ben Finney <bign...@debian.org>
signature.asc
Description: PGP signature