ez_setup?? Easy my @ss!

26 views
Skip to first unread message

Bob

unread,
Aug 24, 2006, 11:32:16 AM8/24/06
to TurboGears
I have been fighting with this for days!

As I understand it, I need easy_install to install TurboGears. - Fair
Enough.
But I need ez_setup.py to install easy_install. - Fair Enough.
But in order for ez_setup.py to run I need setuptools for Python. -
Getting stupid now
And to install setuptools, I need to run ez_setup!!!!!! - What kind of
perverse circular logic is this sh!t!!

All I want to do is install TurboGears. The server I want to install
it on have ABSOLUTLY NO ACCESS to the internet. This is completely out
of my hands and in non-negotiable!!!

After fighting and cursing the d@mn script I am finally here:
servername:/temp/folder/for/turbogears/eggsfiles # python ez_setup.py
-d /temp/folder/for/turbogears/eggsfiles
Downloading
/temp/folder/for/turbogears/eggsfiles/turbogearssetuptools-0.6c1-py2.4.egg
Traceback (most recent call last):
File "ez_setup.py", line 213, in ?
main(sys.argv[1:])
File "ez_setup.py", line 146, in main
egg = download_setuptools(version, to_dir=tmpdir, delay=0)
File "ez_setup.py", line 127, in download_setuptools
src = urllib2.urlopen(url)
File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "/usr/lib/python2.4/urllib2.py", line 350, in open
protocol = req.get_type()
File "/usr/lib/python2.4/urllib2.py", line 233, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type:
/temp/folder/for/turbogears/eggsfiles/turbogearssetuptools-0.6c1-py2.4.egg
servername:/temp/folder/for/turbogears/eggsfiles #

Why is this so hard!! I realise I have only been using Linux for the
past three years, BUT WTF!!!! I specified a directory so that it WOULD
NOT use a URL!!

Okay temper tanterum over now, just needed to release!

Now, how do I fix this and return to normal sanity!

Thanks
Bob

venkatbo

unread,
Aug 24, 2006, 1:35:02 PM8/24/06
to TurboGears
Bob,

Would it be possible to download the needed files to a place
accessible to this target machine. Then you may be able to
follow the tip (using a directory as source of eggs) at:
http://www.turbogears.org/preview/download/install.html#nolinks

hth,
/venkat

Jorge Vargas

unread,
Aug 24, 2006, 1:48:26 PM8/24/06
to turbo...@googlegroups.com
On 8/24/06, Bob <b...@brandt.ie> wrote:
>
please watch your mouth, jsut because you don't undestand something it
doesn't means it's broken

ez_setup IS AN ONLINE TOOL to get setuptools going.
setuptools itself is NOT design to run offline

> All I want to do is install TurboGears. The server I want to install
> it on have ABSOLUTLY NO ACCESS to the internet. This is completely out
> of my hands and in non-negotiable!!!

then get a real server

> Why is this so hard!! I realise I have only been using Linux for the
> past three years, BUT WTF!!!! I specified a directory so that it WOULD
> NOT use a URL!!
>

on the contrary it's quite easy.

> Okay temper tanterum over now, just needed to release!
>
> Now, how do I fix this and return to normal sanity!
>

ok first thing first, you need to do an offline install of setuptools
http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install

then get TG, you can either do this
http://trac.turbogears.org/turbogears/ticket/519
or download all the packages put them in the same dir and tell
easy_install to get the files from . (dot as in CWD)

Karl Guertin

unread,
Aug 24, 2006, 2:05:43 PM8/24/06
to turbo...@googlegroups.com
On 8/24/06, Bob <b...@brandt.ie> wrote:
> But I need ez_setup.py to install easy_install. - Fair Enough.
> But in order for ez_setup.py to run I need setuptools for Python. -
> Getting stupid now
> And to install setuptools, I need to run ez_setup!!!!!! - What kind of
> perverse circular logic is this sh!t!!
>
> All I want to do is install TurboGears. The server I want to install
> it on have ABSOLUTLY NO ACCESS to the internet. This is completely out
> of my hands and in non-negotiable!!!

I've had to do this. The difficult part is installing setuptools.

To fetch the actual turbogears eggs you need setuptools (easy_install)
installed on an internet-connected computer. The magic command line
is:

easy_install -zmaxd /temp/folder/for/turbogears/eggsfiles/ \
-f http://www.turbogears.org/preview/download/index.html TurboGears

You then transfer the eggsfiles folder to your disconnected machine,
manually edit the ez_setup.py file and set the DEFAULT_URL to
"file:///disconnected/path/to/eggsfiles".

If that doesn't work, you'll have to do what I used to do (before
there was a DEFAULT_URL option) and hack the main method to grab your
existing setuptools egg rather than trying to download it (as an aside
if PJE reads this, please have the main method check the current
directory for the appropriate egg before creating the temp dir and
trying to download).

Now that you have easy_install installed ;] you can install TG by doing:

easy_install -f /disconnected/path/to/eggsfiles TurboGears

This should work, I've done it several times but the last time I tried
was around March, so hopefully I remembered everything correctly.

Karl Guertin

unread,
Aug 24, 2006, 2:11:19 PM8/24/06
to turbo...@googlegroups.com
On 8/24/06, Karl Guertin <gray...@gmail.com> wrote:
> (as an aside
> if PJE reads this, please have the main method check the current
> directory for the appropriate egg before creating the temp dir and
> trying to download).

Responding to my own message, it looks like PJE has done just this. Hoorah!

Cliff Wells

unread,
Aug 24, 2006, 2:29:15 PM8/24/06
to turbo...@googlegroups.com
Just to add to the knowledge pool of easy_installed packages ;-)
This isn't related to the OP's problem, but is worth mentioning.

Something I've encountered a few times now is easy_install.pth will
occasionally get wiped out by an errant setup.py. The quick fix is to
simply "cd /usr/lib/python2.4/site-packages; ls -d1 *.egg >
easy_install.pth" then edit out any older duplicate eggs that might be
in there.

The second problem I've found is that older, pre-egg installs of
packages will occasionally get imported rather than the eggs. Just "rm
-rf" the offending package.

Both problems are trivial and easy to fix, but the errors they cause can
be quite confusing.

Regards,
Cliff

On Thu, 2006-08-24 at 08:32 -0700, Bob wrote:
> I have been fighting with this for days!

--

John J Lee

unread,
Aug 24, 2006, 4:42:33 PM8/24/06
to turbo...@googlegroups.com
On Thu, 24 Aug 2006, Cliff Wells wrote:

> Something I've encountered a few times now is easy_install.pth will
> occasionally get wiped out by an errant setup.py. The quick fix is to

[...]

Which projects do that (wipe easy_install.pth)?


John

Cliff Wells

unread,
Aug 24, 2006, 4:57:39 PM8/24/06
to turbo...@googlegroups.com

The most recent one was Cheetah, of all things. It causing the
easy_install of TurboGears (from SVN) to fail, so I downloaded the
tarball and ran "python setup.py install" by hand and it worked. Alas,
a few minutes later I discovered that the reference to the Cheetah egg
was the only line in easy_install.pth (which previously had at least 50
entries).

Now, in all fairness, it may not have been Cheetah that did it. The
failed easy_install of TG may have somehow blanked the file and then
Cheetah was simply added to the blank file (and that seems a plausible
scenario). Cheetah just happens to be the package that the issue
revolved around the last time it happened.

This has happened maybe three times in the last month or so
(unfortunately I don't recall specifics surrounding the other times).
Next time it happens I'll take some notes.

Cliff

--

Tim Lesher

unread,
Aug 24, 2006, 5:43:39 PM8/24/06
to turbo...@googlegroups.com

Pardon me for jumping in, but I just had Pylons do that to me this week.

The easiest fix for me was just "easy_install"-ing each package again.
Since I already had the packages installed, it didn't have to
download or install anything, but it did fix up the path.
--
Tim Lesher <tle...@gmail.com>

Max Bowsher

unread,
Aug 25, 2006, 6:40:31 AM8/25/06
to turbo...@googlegroups.com
Karl Guertin wrote:
> To fetch the actual turbogears eggs you need setuptools (easy_install)
> installed on an internet-connected computer. The magic command line
> is:
>
> easy_install -zmaxd /temp/folder/for/turbogears/eggsfiles/ \
> -f http://www.turbogears.org/preview/download/index.html TurboGears

Thankyou very much! That "-zmaxd" magic is something I'd searched for
but not found.

Unfortunately, it doesn't currently work, since:

error: Could not find suitable distribution for
Requirement.parse('RuleDispatch==0.5a0') (--always-copy skips system and
development eggs)

and RuleDispatch is only available as a development egg at the moment.


I don't suppose anyone has a workaround other than 'hack setuptools' ?

Max.

signature.asc

Karl Guertin

unread,
Aug 25, 2006, 10:30:39 AM8/25/06
to turbo...@googlegroups.com
On 8/25/06, Max Bowsher <ma...@ukf.net> wrote:
> Thankyou very much! That "-zmaxd" magic is something I'd searched for
> but not found.

I only know about it because I complained to Eby and he told me the
code. I've asked him for a --fetch or --fetchonly, since that's what
most people are looking for, but he doesn't seem to think it's needed
since you can figure out -zmaxd by reading the docs.

> I don't suppose anyone has a workaround other than 'hack setuptools' ?

It's sort of a pain, but you can always download the egg manually and
stick it in the appropriate directory. Someone more knowledgable about
setuptools might know another way.

John M Camara

unread,
Aug 25, 2006, 9:01:15 PM8/25/06
to TurboGears
Bob,

I have had my issues with setup tools myself either due to firewalls
and having to do installations on computers that are not connected over
the Internet. I normally just download the egg files into a directory
and move them to the computer which I want to install them. I also add
a file that I call eggServer.py and have easy_install grab them from
the server that is created from eggServer.py. A simple version of
eggServer.py would be

import SimpleHTTPServer
import SocketServer

port = 80

handler = SimpleHTTPServer.SimpleHTTPRequestHandler
httpd = SocketServer.TCPServer(("", port), handler)
httpd.serve_forever()

I would provide the full version of the code but I don't have a copy of
it right now. The code above is just off the top of my head right now
but should work. To get the setup tools install also include it's egg
in the directory and modify DEFAULT_URL in ez_setup.py to look at the
eggServer.

---

Kevin and other TurboGears Developers,

It would be nice if an install package could be made that included all
the eggs and a script similar to the one I described above was included
to make installing TurboGears easier for those who have issues with
setup tools. I use setup tools all the time and when you are not
behind a restrictive firewall it works great but otherwise it can be a
big pain in the ass (especially getting setup tools to install in the
first place).

John

isaac

unread,
Aug 26, 2006, 1:57:25 AM8/26/06
to turbo...@googlegroups.com

On Aug 25, 2006, at 8:01 PM, John M Camara wrote:

> Kevin and other TurboGears Developers,
>
> It would be nice if an install package could be made that included all
> the eggs and a script similar to the one I described above was
> included
> to make installing TurboGears easier for those who have issues with
> setup tools. I use setup tools all the time and when you are not
> behind a restrictive firewall it works great but otherwise it can be a
> big pain in the ass (especially getting setup tools to install in the
> first place).
>
> John

I tend to agree. Here's something to look to for inspiration:

Locomotive http://locomotive.raaum.org/

Basically it's a self-contained environment for Ruby on Rails on Mac
OS X that doesn't install anything on your system (It's all in a
folder). It creates empty projects, starts/stops them, assigns ports,
and will launch a Terminal with all the right PATHs already set so
you can get right to work (or start doing tutorials, etc.). It
includes everything needed to get started (Ruby itself, Rails, etc.)
except for MySQL, with basically no fuss.

The point is, we need something like that for TG (perhaps call it
"Flywheel" or "Axle"?). Reducing barriers for new people to get
started (and making it easier on the experts) is a good thing. It
wouldn't make sense to do before TG 1.0 is ready, but I bet it
wouldn't be hard to slap together something like that, even including
a Universal binary of Python and all the other necessary packages.

-isaac

Kevin Dangoor

unread,
Aug 26, 2006, 2:56:08 PM8/26/06
to turbo...@googlegroups.com
On Aug 26, 2006, at 1:57 AM, isaac wrote:

> The point is, we need something like that for TG (perhaps call it
> "Flywheel" or "Axle"?). Reducing barriers for new people to get
> started (and making it easier on the experts) is a good thing. It
> wouldn't make sense to do before TG 1.0 is ready, but I bet it
> wouldn't be hard to slap together something like that, even including
> a Universal binary of Python and all the other necessary packages.

I should note that while I speak out strongly in favor of setuptools/
eggs, I am also in favor of other packaging efforts. I want to make
things easier for those packaging for linux distros (and the svn
repository has changed around a bit to help that). I'd love to see
complete installers for windows and mac.

I'd love to see a super simple frontend for easy_install.

Kevin

Gustavo Noronha Silva

unread,
Aug 27, 2006, 1:11:07 PM8/27/06
to turbo...@googlegroups.com
Em Sat, 26 Aug 2006 14:56:08 -0400
Kevin Dangoor <dan...@gmail.com> escreveu:

In cases like this, distributions packaging does make a difference,
indeed, since most of the distributions have solved problems like this
(installing offline) numerous times, and are already quite mature.
Debian has loads of nice, well-architectured ways of doing so, for
instance.

BTW, the tarball for 0.9a9 is really good for me as a package maintainer
now, thanks for having taken our comments into account! The only thing I
missed were the docs, which I then grabbed from 0.9a8's one.

In other news, TG 0.9a9 is in experimental, and since SQLAlchemy
support is good, it may be going to unstable soonish (after some
testing in experimental), using SQLAlchemy by default, at least untill
SQLObject gets a real release for 0.7.1 out of the door, which could be
a candidate for Etch's release.

See you,

--
Gustavo Noronha Silva <k...@debian.org>
http://people.debian.org/~kov/

Krys

unread,
Aug 29, 2006, 7:10:51 AM8/29/06
to TurboGears
Karl Guertin wrote:
>
> I've had to do this. The difficult part is installing setuptools.
>

I don't know if it is commonly known or not, so I'll mention it, but
setuptools can be downloaded and installed like a regular (old style)
python package ("python setup.py install"), just grab the zip file from
http://cheeseshop.python.org/pypi/setuptools. This is what I do for
offline installs and it works fine.

I see it as the one non-setuptools install to do and then it's
"easy_install -f ." for the rest of the packages.

Anyway, hope this helps.
Krys

Kevin Dangoor

unread,
Aug 29, 2006, 4:42:02 PM8/29/06
to turbo...@googlegroups.com
On Aug 27, 2006, at 1:11 PM, Gustavo Noronha Silva wrote:

> BTW, the tarball for 0.9a9 is really good for me as a package
> maintainer
> now, thanks for having taken our comments into account! The only
> thing I
> missed were the docs, which I then grabbed from 0.9a8's one.

The website has been purposefully pulled from the tarball. The docs
are moving to a wiki...

Kevin

Reply all
Reply to author
Forward
0 new messages