import datetime

S

shaboo

Hi Guys,

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~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.

Any help will be appreciated.
 
L

Lee Harr

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

~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
sys.path

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.
 
S

shaboo

It does say Python 2.4.2
~~~~~~~~~~~~~~~~~~~~~~~~
Python 2.4.2 (#2, Jan 30 2006, 20:02:09) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.~~~~~~~~~~~~~~~~~~~~~~~~

I did look at the sys.path but the issue is that I dont see a module
name datetime anywhere. Only datetime thing that is there is in include
directory and it is datetime.h, which I think is for C interface. I
have a python installed on my Windows desktop and it is working fine
there. Where is the datetime module stored? Does any body know?
 
F

Fredrik Lundh

shaboo said:
It does say Python 2.4.2
~~~~~~~~~~~~~~~~~~~~~~~~
Python 2.4.2 (#2, Jan 30 2006, 20:02:09) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.~~~~~~~~~~~~~~~~~~~~~~~~

I did look at the sys.path but the issue is that I dont see a module
name datetime anywhere. Only datetime thing that is there is in include
directory and it is datetime.h, which I think is for C interface. I
have a python installed on my Windows desktop and it is working fine
there. Where is the datetime module stored? Does any body know?

on windows, it's linked to the interpreter.
<module 'datetime' from '/usr/local/lib/python2.4/lib-dynload/datetime.so'>

</F>
 
L

Lee Harr

I did look at the sys.path but the issue is that I dont see a module
on windows, it's linked to the interpreter.

<module 'datetime' from '/usr/local/lib/python2.4/lib-dynload/datetime.so'>


So maybe there is just a problem with the way Python was
built. Is that from an "official" HP-UX package? You could
ask on an HP-UX list.

Alternatively, you could try compiling Python yourself.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,214
Messages
2,571,112
Members
47,705
Latest member
noname22

Latest Threads

Top