The bug tracker for setuptools 0.7 or higher is on BitBucket

 

Issue14

Title Executing "./ez_setup.py" 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.

Files
File name Uploaded Type Edit Remove
patch.txt zooko, 2008-08-18.22:50:17 text/plain
Messages
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 `ez_setup.py <http://peak.telecommunity.com/dist/ez_setup.py>`_, 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 ``ez_setup.py`` 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 ``ez_setup.py`` 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 <http://ntlmaps.sf.net/>`_, which lets you get past such firewalls
-in the same way that your web browser(s) do.  This will let ``ez_setup.py``
-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
-<http://pypi.python.org/pypi/setuptools>`_ using a computer with internet
-access.  Place the egg in the same directory as ``ez_setup.py`` 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`__.
 
+__ http://pypi.python.org/pypi/setuptools#installation-instructions
 
 Troubleshooting
 ~~~~~~~~~~~~~~~
msg70 (view) Author: pje Date: 2008-08-05.14:50:07
Note: this is a documentation bug; ez_setup.py is deprecated as an end-user
installation method; docs should refer instead to
http://pypi.python.org/pypi/setuptools#installation-instructions and ez_setup.py
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
http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install and
my attempt to install ended with:

bash: ./ez_setup.py: 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 ez_setup.py 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
http://bugs.python.org/setuptools/issue27 .  Most importantly, it means that the
instructions can remain simple, just as they currently are: "Download
ez_setup.py, and run it".
msg30 (view) Author: zooko Date: 2008-05-31.17:58:51
I was following these instructions:

http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install
msg29 (view) Author: tseaver Date: 2008-05-31.17:43:13
-1 to adding '/usr/bin/env':  ez_setup.py 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 'setup.py'
of the module which is depending on it).
msg18 (view) Author: zooko Date: 2008-05-30.16:09:17
On my Mac:

$ ./ez_setup.py
bash: ./ez_setup.py: 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.
History
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 "./ez_setup.py" fails. -> Executing "./ez_setup.py" fails because shebang line expects "python" executable which doesn't work on some of my platforms.
2008-05-30 16:09:17zookocreate