By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,994 Members | 1,166 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,994 IT Pros & Developers. It's quick & easy.

problem with import in python 2.2.3

P: n/a
Hi,

I have written a python script that works perfectly in python 2.4.4
and python 2.4.3 but when I try to use the same script on an older
system with python 2.2.3 I get the following error.

../backup_all_mysql_databases.py
Traceback (most recent call last):
File "./backup_all_mysql_databases.py", line 5, in ?
from datetime import date
ImportError: No module named datetime

Does anyone know why the datetime module is not being found in python
2.2.3 and how I can make the script work in the older version of python?

--
Kind Regards,
Anthony Irwin

http://www.irwinresources.com
http://www.makehomebusiness.com
email: anthony at above domains, - www.
May 17 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
En Thu, 17 May 2007 00:37:26 -0300, Anthony Irwin
<no****@noemailhere.nowhereescribió:
./backup_all_mysql_databases.py
Traceback (most recent call last):
File "./backup_all_mysql_databases.py", line 5, in ?
from datetime import date
ImportError: No module named datetime

Does anyone know why the datetime module is not being found in python
2.2.3 and how I can make the script work in the older version of python?
datetime is included on 2.3 and above.
Try copying the 2.3 version on your 2.2 installation, maybe it Just
Works...

--
Gabriel Genellina

May 17 '07 #2

P: n/a
On 5/17/07, Anthony Irwin <no****@noemailhere.nowherewrote:
Does anyone know why the datetime module is not being found in python
2.2.3 and how I can make the script work in the older version of python?
The datetime modules was added in Python 2.3 - that's why you aren't
finding it. This might help - http://tinyurl.com/37677u - but I've not
tried it myself.

--
Cheers,
Simon B.
si***@brunningonline.net
http://www.brunningonline.net/simon/blog/
GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues
May 17 '07 #3

P: n/a
Hi Guys,

Thanks for the replies I ended up rewriting my code to use the
time.strftime() library but unfortunately the MySQLdb module I use
needs python 2.3 or higher so it looks like I have to update python on
the older system anyway.

--
Kind Regards,
Anthony Irwin

http://www.irwinresources.com
http://www.makehomebusiness.com
email: anthony at above domains, - www.
May 18 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.