TurboGears, distutils...works, but a bit odd...

1 view
Skip to first unread message

JimC

unread,
Nov 1, 2007, 3:10:44 PM11/1/07
to Movable Python
I decided to have another look at TurboGears. It's got setuptools
pretty tightly integrated, so I went ahead and installed it that way:
in an IPython shell, typed 'python ez_setup.py' (python being a magic
function for movable python).

It complained that the movpy/lib/Lib/site-packages directory did not
exist, so I created it and tried again. Worked that time, and even
created a movpy/lib/Scripts directory for me.

Then I ran 'python tgsetup.py', the TurboGears installation script.
That ran and put lots of eggs in the same site-packages directory.

The I started a new IPython shell and looked at sys.path, and lo and
behold it contained all the eggs. Which surprised me, as I was
expecting to have to add entries to syspaths.pth. Also, they were all
listed at the _front_ of sys.paths, implying they'd been added after
customize.py was run (I insert some directories at the front of
sys.paths in customize.py). I tried importing various modules,
turbogears, kid, pkg_resources--all imported with no errors.

The I created a 'tgadmin' magic function to run the tg-admin-
script.py, started a new shell, and tried 'tgadmin quickstart'. That
failed, saying it couldn't find pkg_resources.

So I copied the entries from lib/Lib/site-packages/easy-install.pth to
syspaths.pth (modified appropriately for the relative location) and
started a new shell. Now the eggs appeared in sys.paths _after_ the
stuff I inserted in customize.py, 'tgadmin quickstart' worked, and the
resulting webapp also ran properly.

So anyway, it was very easy to get it working, I'm just curious about
what was going on under the hood during those earlier steps...

-Jim C.

Michael Foord

unread,
Nov 5, 2007, 10:46:41 AM11/5/07
to mo...@googlegroups.com
Hello Jim,

That's cool. I've put no effort into getting Movable Python with eggs -
but it sounds like it shouldn't be too hard to provide a general solution.

I'll post your writeup as a blog entry sometime.

Thanks for this.

Michael Foord
http://www.manning.com/foord

Reply all
Reply to author
Forward
0 new messages