[Tutor] Modules/Setup in 2.2 source package [and IDLE in Slackware]

Rob McGee i812@iname.com
Thu, 27 Dec 2001 08:50:32 -0600

As always, thanks for the reply, Danny. I'll also be replying to an old
post from Jeff, because I think I may have a clue on what went wrong for
him over a week ago.

On Thu, Dec 27, 2001 at 01:09:16AM -0800, Danny Yoo wrote:
> > I'm a little confused about Modules/Setup in Python 2.2. If I do
> > nothing to it, does that mean I get none of those modules? That seems
> > like an unusual amount of manual labor for configuring a package. :)
> Think of it more like manual override.  The './configure' step on setting
> up Python on a Unix system should autodetect everything.  The
> Modules/Setup file is for unusual situations where the autodetect isn't
> seeing anything.

My Modules/Setup.config didn't have much in it. Only two things: threads
and signals modules. Autodetection seems to be a bit weak on Slackware.
(I guess I'm not surprised. :)

> > I'm upgrading from 2.0.1 which came with Slackware 8. I think I built
> > 2.0 from source before that, and I don't recall having to do so much
> > to it to make it work. But maybe that was because I didn't do much
> > with it.
> I remember that on older versions of Python (1.52), I had to uncomment
> sections of Modules/Setup when I wanted to get Tkinter working.

I went through and uncommented what was appropriate for Tkinter. I got
IDLE to start and thus confirmed that Tkinter was working. However, IDLE
died with a segfault when I tried to close its help ("press F1") window
using the widget from the window manager (IceWM 1.0.8.) I haven't played
with it any more than that so I don't know more yet.

An interesting thing to note: IDLE from 2.0.1 doesn't work with the 2.2
interpreter. It crashed with a SyntaxError:
    import * is not allowed in function 'main' because it contains a
    nested function with free variables

BTW, I don't really expect you or anyone here to know the solution to
the problems Jeff and I are having with IDLE. I'm just posting for the
record and possibly for Jeff's benefit.

> Thankfully, Python configuration is a little smarter now, so you probably
> don't need to touch Modules/Setup.

I really don't know. :) I can't afford to take a chance because I don't
have enough time or CPU power to go recompiling things. I went ahead and
edited mine. Other than Tkinter I also got GNU readline working. I guess
the fact that everything compiled without errors tends to indicate that
I edited things correctly. (Actually I did have one mistake on which
"make" choked, but I fixed that.)

On Wed, Dec 19, 2001 at 04:11:46PM -0500, Jeff Jones wrote:
> I tried ./idle but got this error (retyped from linux to outlook):
> Traceback (most recent call last):
>   File "./idle", line 5, in ?
>      from idlelib import idleconf
> ImportError: No module IdleConf

I believe this is a PYTHONPATH problem. The "IdleConf" module it's
trying to load is not in a directory in your $PYTHONPATH variable. I'm
sure you can easily fix this in a number of ways. The way that worked
for me was simply to run "./idle.py" instead of just "idle". Apparently
by doing that I caused it to search the current directory in addition to
my non-existent PYTHONPATH variable.

Other (probably better) ways to fix it include to start IDLE from a
shell script which sets PYTHONPATH before the "idle" command, or to dig
through the Makefile and see if you can compile in some default values.
I think there's something about PYTHONPATH in Modules/Setup, too (it's
actually an extension of the Makefile, I think.)

> Thanks for all your help! I know I have seen people ask similar ?'s. Is
> there an archive of this list somewhere?

I don't know the full URL but I've seen it at www.activestate.com. That
archive isn't completely up-to-date; I think it must only be updated
once a month.

Jeff, let me know if you want me to send my Modules/Setup file. That
might help you restore some other missing functionality. In the meantime
you might want to "make uninstall" and revert to 2.0.1 -- that's what I
plan to do if I can't get IDLE working reliably.

It also might not hurt to ask on the Slackware newsgroup if anyone has
gotten Python 2.2 to work with all the bells and whistles (and the
"batteries included". :) I still don't have my own Usenet access set up,
though. :(

    Rob - /dev/rob0