[Tutor] problem with threading module

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Wed, 12 Sep 2001 00:21:13 -0700 (PDT)


On Wed, 12 Sep 2001, lonetwin wrote:

> Hi everybody,
>      Could someone please explain this:
> ###########################################################
> Python 2.0 (#1, Apr 11 2001, 19:18:08)
> [GCC 2.96 20000731 (Linux-Mandrake 8.0 2.96-0.48mdk)] on linux-i386
> Type "copyright", "credits" or "license" for more information.
> >>> import thread
> >>> import threading
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "./threading.py", line 12, in ?
>     class TestThread(threading.Thread):
> AttributeError: Thread

As a guess: it sounds like you may have called your program
"threading.py", or perhaps there's a file called 'threading.py' in your
current directory.

If so, you might want to either move or rename it, as 'threading' is also
the name of the Python module 'threading'. It sounds like Python's getting
confused between the official module and the one in your current
directory, so they may be conflicting.

However, these are wild guesses.  Can you give us some more information?