Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install python-dateutil on Windows?

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

like image 574
Mark Ransom Avatar asked May 18 '09 18:05

Mark Ransom


People also ask

Is dateutil included in Python?

Python 2. x has a great function called dateutil. parser which turns an ISO8601 formatted date into a python datetime value. It's not present in Python 3.


2 Answers

If dateutil is missing install it via:

pip install python-dateutil 

Or on Ubuntu:

sudo apt-get install python-dateutil 
like image 168
Stan Reshetnyk Avatar answered Sep 25 '22 08:09

Stan Reshetnyk


Why didn't someone tell me I was being a total noob? All I had to do was copy the dateutil directory to someplace in my Python path, and it was good to go.

like image 25
Mark Ransom Avatar answered Sep 26 '22 08:09

Mark Ransom