problem with setuptools version in SVN 398

1 view
Skip to first unread message

Michael Schneider

unread,
Dec 27, 2005, 7:16:16 PM12/27/05
to TurboGears
Hello All,

I just did a SVN up to pick the changes today (successful for TG and
3rd parties).

I then did a setup.py and go

---------------------------------------------------------------------

Setup: windows 32 bit XP (fully patched)
python 2.4.2


At revision 398.

E:\pythonpkgs\turbogears_svn\turbogears>setup.py install
The required version of setuptools (>=0.6a9dev_r41815) is not
available, and
can't be installed while this script is running. Please install
a more recent version first.

E:\pythonpkgs\turbogears_svn\turbogears>

Sean De La Torre

unread,
Dec 27, 2005, 8:22:39 PM12/27/05
to TurboGears
I ran into the same issue. To fix it, you will need to update
setuptools. Download the ez_setup.py script from
http://www.turbogears.org/download/ez_setup.py and place it in a
directory that is not in the TG code tree (anywhere else is fine). Run
the script using the following command:

ez_setup.py -U setuptools

After successfully upgrading setuptools, re-run the TG "setup.py
install" command.

Sean

Kevin Dangoor

unread,
Dec 27, 2005, 10:43:54 PM12/27/05
to turbo...@googlegroups.com

Note that when you have an svn checkout, the same ez_setup.py is right
at the top of the trunk (next to setup.py). So, you can run the
command from right there.

Kevin

Michael Schneider

unread,
Dec 27, 2005, 11:27:24 PM12/27/05
to TurboGears
Kevin and Sean,

Thanks for the tips,

I did an svn up to pick up anything new, and then tried the ex_setup.py
-U setuptools,
and got the following error.

I can clean everything out of my install if that would help.

Thanks
Mike
-----------------------------------------------------------------
E:\pythonpkgs\turbogears_svn\turbogears>ez_setup.py -U setuptools
Downloading
http://www.turbogears.org/download/eggs/setuptools-0.6a9dev_r41815-p
y2.4.eggsetuptools-0.6a9dev_r41815-py2.4.egg
Traceback (most recent call last):
File "E:\pythonpkgs\turbogears_svn\turbogears\ez_setup.py", line 214,
in ?
main(sys.argv[1:])
File "E:\pythonpkgs\turbogears_svn\turbogears\ez_setup.py", line 167,
in main
main(list(argv)+[download_setuptools(delay=0)])
File "E:\pythonpkgs\turbogears_svn\turbogears\ez_setup.py", line 128,
in downl
oad_setuptools
src = urllib2.urlopen(url)
File "C:\Python24\lib\urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "C:\Python24\lib\urllib2.py", line 364, in open
response = meth(req, response)
File "C:\Python24\lib\urllib2.py", line 471, in http_response
response = self.parent.error(
File "C:\Python24\lib\urllib2.py", line 402, in error
return self._call_chain(*args)
File "C:\Python24\lib\urllib2.py", line 337, in _call_chain
result = func(*args)
File "C:\Python24\lib\urllib2.py", line 480, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 300: Multiple Choices

E:\pythonpkgs\turbogears_svn\turbogears>

Sean De La Torre

unread,
Dec 27, 2005, 11:43:27 PM12/27/05
to TurboGears
I found that running ez_setup.py from the top-level of the TG trunk
gave me problems (I'm on WinXP), so I copied ez_setup.py to a different
directory and everything worked fine. Try copying ez_setup.py to
another directory (perhaps E:\pythonpkgs in your case) and run
"ez_setup.py -U setuptools" from there.

Sean

Michael Schneider

unread,
Dec 28, 2005, 12:15:01 AM12/28/05
to TurboGears
Sean,

Thanks for the tip, I copied ez_setup.py into a clean directory, and
ran
with the same error.

I deleted setuptools from my python install, and had the same problem.

I am open to any additional tricks to try :-)

Thanks
Mike

Keir Mierle

unread,
Dec 28, 2005, 12:51:11 AM12/28/05
to TurboGears
I am also having this problem. If one looks carefully at the URL
ez_setup is fetching, one will notice the duplicated filename. The
source of the problem is the following lines in ez_setup.py:

(line 18, notice included file name)
DEFAULT_URL =
"http://www.turbogears.org/download/eggs/setuptools-0.6a9dev_r41815-py2.4.egg"

Along with the following later on in download_setuptools():

def download_setuptools(
version=DEFAULT_VERSION, download_base=DEFAULT_URL,
to_dir=os.curdir,
delay = 15
):
"""Download setuptools from a specified location and return its
filename

`version` should be a valid setuptools version number that is
available
as an egg for download under the `download_base` URL (which should
end
with a '/'). `to_dir` is the directory where the egg will be
downloaded.
`delay` is the number of seconds to pause before an actual download
attempt.
"""
import urllib2, shutil
egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3])
url = download_base + egg_name # ************** Problem here

As the docstring tells us, it seems the DEFAULT_URL is at fault, though
to be honest I know nothing about setuptools. I merely changed the line
to

url = download_base

to fix the problem temporarily.

Keir

Sean De La Torre

unread,
Dec 28, 2005, 12:58:46 AM12/28/05
to TurboGears
There's an error in the ez_setup.py file. Change line 18 from

DEFAULT_URL =
"http://www.turbogears.org/download/eggs/setuptools-0.6a9dev_r41815-py2.4.egg"

to

DEFAULT_URL = "http://www.turbogears.org/download/eggs/"

The egg URL is getting mangled with that extra information and is
preventing the installation from taking place (the URL becomes
http://www.turbogears.org/download/eggs/setuptools-0.6a9dev_r41815-py2.4.eggsetuptools-0.6a9dev_r41815-py2.4.egg
instead of
http://www.turbogears.org/download/eggs/setuptools-0.6a9dev_r41815-py2.4.egg
in the original code).

Michael Schneider

unread,
Dec 28, 2005, 9:40:28 AM12/28/05
to TurboGears
Thanks Keir,

Your workaround worked for me.

Thanks
Mike

Kevin Dangoor

unread,
Dec 28, 2005, 9:40:50 AM12/28/05
to turbo...@googlegroups.com
Weird. I wonder why this worked for me... I've applied the change and
pushed it out.

From what Phillip has told me in the past, it seems like you can run
ez_setup.py setuptools even from within a TurboGears directory. You
just couldn't run ez_setup.py TurboGears because there would be
confusion about what setuptools sees in the current directory.

Let me know how this fixed ez_setup works for you all.

Kevin


--
Kevin Dangoor
Author of the Zesty News RSS newsreader

email: k...@blazingthings.com
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com

Kevin Dangoor

unread,
Dec 28, 2005, 10:07:52 AM12/28/05
to turbo...@googlegroups.com
Hi Mike,

Your ticket reports a problem in r402, but 402 is the one that I just
checked in a short bit ago with Sean De La Torre's suggested fix for
ez_setup. Sean's fix *looked* correct.

I just tried 402's ez_setup (from the turbogears directory) on my
Windows machine and it worked fine.

python ez_setup.py setuptools

was the command line I used...

Kevin

Sean De La Torre

unread,
Dec 28, 2005, 10:23:15 AM12/28/05
to TurboGears
It worked for me too when run from the TG directory.

Sean

Reply all
Reply to author
Forward
0 new messages