How to install python-dateutil on Windows?

Mark Ransom picture Mark Ransom · May 18, 2009 · Viewed 135k times · Source

I'm trying to convert some date/times to UTC, which I thought would be dead simple in Python - batteries included, right? Well, it would be simple except that Python (2.6) doesn't include any tzinfo classes. No problem, a quick search turns up python-dateutil which should do exactly what I need.

The problem is that I need to install it on Windows. I was able to upack the .tar.gz2 distribution using 7-zip, but now I'm left with a collection of files and no guidance on how to proceed. When I try to run setup.py I get the error "No module named setuptools".

Answer

Stan Reshetnyk picture Stan Reshetnyk · Aug 25, 2011

If dateutil is missing install it via:

pip install python-dateutil

Or on Ubuntu:

sudo apt-get install python-dateutil