The bug tracker for setuptools 0.7 or higher is on BitBucket



Title Executing "./" fails because shebang line expects "python" executable which doesn't work on some of my platforms.
Priority bug Status resolved
Superseder Nosy List pje, tseaver, zooko
Assigned To Keywords

Created on 2008-05-30.16:09:17 by zooko, last changed 2008-08-21.17:24:00 by pje.

File name Uploaded Type Edit Remove
patch.txt zooko, 2008-08-18.22:50:17 text/plain
msg89 (view) Author: pje Date: 2008-08-21.17:23:59
Documentation updated in trunk and branch
msg86 (view) Author: zooko Date: 2008-08-18.22:50:17
Here's my attempt to fix the documentation bug:

--- old-dw/EasyInstall.txt      2008-08-18 16:50:10.000000000 -0600
+++ new-dw/EasyInstall.txt      2008-08-18 16:50:10.000000000 -0600
@@ -30,48 +30,10 @@
 Installing "Easy Install"
-Download ` <>`_, and
-run it; this will download and install the appropriate ``setuptools`` egg for
-your Python version.  (You will need at least Python 2.3.5, or if you are on a
-64-bit platform, Python 2.4.)  An ``easy_install`` script will be installed in
-the normal location for Python scripts on your platform.  (Windows users, don't
-put ```` inside your Python installation; please put it in some
-other directory before running it.)
-You may receive a message telling you about an obsolete version of setuptools
-being present; if so, you must be sure to delete it entirely, along with the
-old ``pkg_resources`` module if it's present on ``sys.path``.
-The ```` script accepts the same `Command-Line Options`_ and
-`Configuration Files`_  as ``easy_install`` itself, so you can use them to
-control its behavior.  In particular, you can use the --script-dir option to
-direct script installation to a custom location.  You should not, however,
-use custom installation locations without first reading the section below on
-`Custom Installation Locations`_.
-The instructions you've just read assume that:
-* You are installling to Python's primary ``site-packages`` directory
-* You have unrestricted internet access on the computer where you are
-  installing.
-If you are behind an NTLM-based firewall that prevents Python programs from
-accessing the net directly, you may wish to first install and use the `APS
-proxy server <>`_, which lets you get past such firewalls
-in the same way that your web browser(s) do.  This will let ````
-download the setuptools egg.
-If you can't use APS, or don't have internet access at all, you will need to
-first download the appropriate ``.egg`` file from the `setuptools PyPI page
-<>`_ using a computer with internet
-access.  Place the egg in the same directory as ```` on the target
-computer before running it.
-If you are installing to a custom location or do not have write access to
-Python's primary ``site-packages`` directory, please also see the section below
-on `Custom Installation Locations`_ for more detailed instructions.
+Please follow the installation instructions on the `Python Package
+Index page`__.
msg70 (view) Author: pje Date: 2008-08-05.14:50:07
Note: this is a documentation bug; is deprecated as an end-user
installation method; docs should refer instead to and
should get a magic #!sh header that tells people to run it with the python
interpreter of their choice.
msg66 (view) Author: zooko Date: 2008-08-01.20:06:17
I just did this again -- I followed the instructions from and
my attempt to install ended with:

bash: ./ python: bad interpreter: No such file or directory

This was on Ubuntu Hardy.

There are at least two ways to make it so that users don't get this failure:

1.  Change the instructions at that link to instruct people to execute a Python
interpreter and pass as argument.

2.  Change the shebang line from "#!python" to "#!/usr/bin/env python".

I vote for #2.  It works everywhere (I've tried it everywhere), and it is
similar to what people do for other situations such as .  Most importantly, it means that the
instructions can remain simple, just as they currently are: "Download, and run it".
msg30 (view) Author: zooko Date: 2008-05-31.17:58:51
I was following these instructions:
msg29 (view) Author: tseaver Date: 2008-05-31.17:43:13
-1 to adding '/usr/bin/env': is not supposed to run as an
arbitrary script, but only in the context of the Python interpreter for
which setuptools is being tested / installed (typically via the ''
of the module which is depending on it).
msg18 (view) Author: zooko Date: 2008-05-30.16:09:17
On my Mac:

$ ./
bash: ./ python: bad interpreter: No such file or directory

On Cygwin I get the same sort of error.  Replacing the shebang line "#!python"
with "#!/usr/bin/env python" fixes this problem.  I've tested this fix on Mac,
Linux, Solaris, Cygwin, and Windows.
Date User Action Args
2008-08-21 17:24:00pjesetstatus: in-progress -> resolved
messages: + msg89
keyword: - needpatch
2008-08-18 22:50:17zookosetfiles: + patch.txt
messages: + msg86
2008-08-05 15:07:07pjesetkeyword: + needpatch
2008-08-05 14:50:07pjesetstatus: chatting -> in-progress
nosy: + pje
messages: + msg70
2008-08-01 20:06:17zookosetmessages: + msg66
2008-05-31 17:58:51zookosetmessages: + msg30
2008-05-31 17:43:13tseaversetstatus: unread -> chatting
nosy: + tseaver
messages: + msg29
2008-05-30 16:13:12zookosettitle: Executing "./" fails. -> Executing "./" fails because shebang line expects "python" executable which doesn't work on some of my platforms.
2008-05-30 16:09:17zookocreate