Weird problems with import and IDLE

Steven Taschuk staschuk at telusplanet.net
Fri Feb 21 20:33:01 EST 2003


Quoth David Reis:
  [...]
> AAAAARGH! 
> I am near to collapsing over here... would be nice if someone could tell
> me how to get my modules working and my GUI up again....

As I understand it, the symptoms are as follows:
	1. IDLE isn't importing modules in the same directory as
	   the module they're being imported from.  This problem
	   persists even in the face of various (unspecified)
	   configuration changes.
	2. IDLE is now completely broken on this machine and
	   will not run.  Ditto IDLEFork.  (But you feel this is
	   probably unrelated, since you've had a history of
	   unreliability with IDLE.)
	3. Running the script from the command line gets past
	   the import that was failing in (1), but fails on the
	   following line in the script, which tries to open a
	   file using a relative path.
	4. Replacing the relative path with an absolute path
	   lets the script get past (3), but it then fails on
	   the following line, which is trying to invoke a
	   function defined in one of the imported modules.
Is that right?

Not knowing anything but the above: the hosedness of the IDEs, the
history of problems therewith, and the bizarre line-by-line
successive failures make me wonder if there's something systemic
wrong which is manifesting itself as random-seeming errors.

It is difficult to say anything more helpful with the information
given.  The following details might be useful:

A. What OS you're running, what version of Python you're running,
and how that version was installed (e.g., from source? from some
binary? etc.).

B. The exact code which is failing.  If it's more than, say, ten
or twenty lines, cut it down to that size, verify that the
cut-down version also fails, and post that.

C. Since you feel the search path might be related: your current
directory when you try to run the script, the locations of the
relevant files, and how the search path on your machine is
configured.  (Details on the configuration changes you made to try
to get IDLE importing your modules might also be useful, if you
happen to remember them or wrote them down.  But the present
configuration is most important.)

D. The exact command line you're using to invoke your script, as
well as the complete and exact error message, with traceback. 
Just cut-and-paste all this from your command-line window.

E. A more detailed description of what IDLE does when you try to
run it.  Is there any output at all?  If so, what is it? After you
start it, does your OS think there's a process running?

And one additional obvious question: You mentioned that this all
started when you split up your code into separate modules.  Does
the old, not split-up, code still run?

-- 
Steven Taschuk                                7\ 7'Z {&~         .
staschuk at telusplanet.net                        Y r          --/hG-
                                            (__/ )_             1^1`





More information about the Python-list mailing list