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
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~ 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.
Any help will be appreciated. 4 6224
> 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
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.
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?
"shaboo" wrote: 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. import datetime datetime
<module 'datetime' (built-in)>
import sys "datetime" in sys.builtin_mod ule_names
True
on other platforms, it may be linked to the interpreter or placed in
a shared library:
import datetime datetime
<module 'datetime' from '/usr/local/lib/python2.4/lib-dynload/datetime.so'>
</F>
>> 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.
import datetime datetime<module 'datetime' (built-in)> import sys "datetime" in sys.builtin_mod ule_names True
on other platforms, it may be linked to the interpreter or placed in a shared library: import datetime datetime
<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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: sdhyok |
last post by:
Here is my situation.
To add more functionalities to a standard library(datetime) in python,
I am implementing my own code called vp.datetime
(directory structure, vp/datetime.py).
To make it clear the file extends functions of the standard datetime,
I like to use the same name with its standard library.
The problem is that I have to use...
|
by: DilbertFan |
last post by:
Hi,
I really thought that I had this importing business down.
I recently downloaded and installed mx module for the DateTime class.
In IDLE, I go:
import mx
mx.DateTime.DateTime(2004)
|
by: bncarper |
last post by:
Relatively new to python. I can get the following to work from the
command line:
Python 2.3.4 (#2, Aug 18 2004, 21:49:15)
on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> d = datetime.datetime.today()
>>> d
datetime.datetime(2004, 12, 10, 6, 13, 28, 154472)
|
by: Max M |
last post by:
# -*- coding: latin-1 -*-
"""
I am currently using the datetime package, but I find that the design is
oddly
asymmetric. I would like to know why. Or perhaps I have misunderstood
how it should be used?
I can make a datetime easily enough
|
by: Adam Monsen |
last post by:
Say I have the following datetime object:
>>> from datetime import datetime
>>> d = datetime(2005, 8, 10, 15, 43)
I happen to know this is a local time from the Netherlands, so I
assume the tzinfo (if it were present) should indicate Central European
Summer Time ("Summer" indicates daylight savings).
How do I convert this date/time...
| |
by: James |
last post by:
I need to import a bunch of data into our database for which there's a
single entry each day which occurs at the same time every day in local
time - so I need to convert this to UTC taking into account local
daylight savings. However daylight savings just don't seem to be
working at all...
Python 2.3.5 (#2, May 4 2005, 08:51:39)
on...
|
by: skip |
last post by:
Running from Subversion, I see confusing (to me) behavior related to
division of datetime.timedelta objects by integers:
% python
Python 2.6a0 (trunk:57277:57280M, Aug 28 2007, 17:44:49)
on darwin
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>...
|
by: PhongPham |
last post by:
I used environment on Fedora core 6 and tried with python 2.5.2 package on board chip mips and platform 2.6 is ok (although when "make" still have error:
"/bin/sh: line 2: ./python: cannot execute binary file
make: *** Error 126 "
but I can run it on this board ( GCC 4.0.4, binutils2.17, uClibc0.9.28.3))."
I don't understand why I...
|
by: Christian Heimes |
last post by:
Rick King schrieb:
datetime.date is a C extension class. Subclassing of extension classes
may not always work as you'd expect it.
Christian
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |