Time Module

Peter Hansen peter at engcorp.com
Mon Jul 12 15:24:03 CEST 2004

Tim Golden wrote:

> I've never seen something like this myself. It's curious enough that
> the .pyc files have bad mtimes, but hardly fatal. .pyc files are
> compiled copies of their respective .py files, but Python works fine
> without them. I can't imagine what could cause time not to import.
> I bet there's no configure option to exclude the module from the
> build, so presumably one of the previous errors has caused enough
> of a problem to prevent time from being available. Try doing 
> "import sys" (which is also a built-in module).

On my machine,

Python 2.2.1 (#1, Aug 30 2002, 12:15:30)
[GCC 3.2 20020822 (Red Hat Linux Rawhide 3.2-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import time
 >>> time.__file__

After renaming file that to hide it:
 >>> import time
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
ImportError: No module named time

So the question is, does this file exist on your machine?  If not,
you have a broken installation and your admin needs to fix it or


More information about the Python-list mailing list