Replaced time module with my own on accident - help
Sean Berry
sean at buildingonline.com
Wed Oct 20 15:10:04 EDT 2004
> On Wed, 20 Oct 2004 11:49:58 -0700, Sean Berry <sean at buildingonline.com>
> wrote:
>> I was writing a little script to test different functions of the time
>> module. Like an idiot, I named the test script time.py.
>>
>> Then when I tried to do a "import time" call, I got an error.
>>
>> So, my time.py has overwritten the time.py builtin mod.
>
> Your problem may be a little bit simpler to solve. When you do a
> 'import time' is looks first in the current directory; if it doesn't
> find a module by that name, it searches the module path (I forgot the
> name), which usually on Unix points to the lib subdirectory of your
> Python installation. It appears that you own (broken) time.py module
> is just getting the precedence over the standard one. If that's the
> case, just removing your own time.py (or renaming it) should solve
> your problem.
>
Thanks for the heads up. I had already tried that, but I did not realize
that the .pyc file had been compiled and was in the directory as well.
Deleted it and all is fine.
Thanks Carlos.
More information about the Python-list
mailing list