import datetime

Lee Harr lee at
Tue Jan 31 18:21:51 EST 2006

> I have just installed Python2.4.2 on our HP-UX system. But when I try
> to import datetime modlue I get the following error
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>> from datetime import datetime
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: No module named datetime
> ~~~~~~~~~~~~~~~~~~~~~~~~~~
> Am I missing any path? because I tried to import 'textwrap module and
> that import worked fine. 

You may have more than one version of Python. What does it
say when you first start it from a command line? Mine says:

$ python
Python 2.3.5 (#2, Sep  4 2005, 22:01:42)
[GCC 3.3.5 (Debian 1:3.3.5-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

If it is not python 2.4 like you expected, you could try
running it as python2.4 and see if the modules are there.

If it is already 2.4, try this:

import sys

and see which paths are being searched. Look around in
there and see if the datetime module is where it is
supposed to be.

Beyond that, you should probably ask on an HP-UX list.

More information about the Python-list mailing list