How to install python-dateutil on windows?

I'm trying to convert some date / time to UTC, which I thought would be simple in Python, including batteries, right? Well, that would be simple, except that Python (2.6) does not include any tzinfo classes. No problem, a quick search appears python-dateutil , which should do exactly what I need.

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

+48
python install python-dateutil
May 18 '09 at 18:38
source share
11 answers

If dateutil is missing, install it via:

pip install python-dateutil 

Or on Ubuntu:

 sudo apt-get install python-dateutil 
+61
Aug 25 2018-11-11T00:
source share
โ€” -

Why didnโ€™t someone tell me that Iโ€™m a complete nob? All I had to do was copy the dateutil directory at some point in my Python path, and it would be nice to go.

+17
May 18, '09 at 21:15
source share

It looks like setup.py uses easy_install (i.e. setuptools ). Just install the setuptools package and everything will be installed.

To install setuptools in Python 2.6, see the answer to this question .

+6
May 18 '09 at 18:49
source share

Install from "Unofficial Windows Binaries for Python Extension Packs"

http://www.lfd.uci.edu/~gohlke/pythonlibs/#python-dateutil

Pretty much every package you need.

+5
Sep 26 '13 at 14:02
source share

This is a little tricky for people who don't use the prompt command. All you have to do this is to open the directory in which python is installed (by default C: \ Python27) and open the command line there (shift + right-click and select the command prompt window here), and then enter:

python -m pip install python-dateutil

Hope this helps.

+3
Dec 09 '15 at 3:12
source share

Using setup from distutils.core instead of setuptools in setup.py also worked for me:

 #from setuptools import setup from distutils.core import setup 
+2
Apr 26 2018-10-21T00:
source share

If you are offline and have not enabled the package, you can use the command line.

Go to the unoccupied folder and run:

 python setup.py install 
+1
Aug 24 '15 at 9:24
source share

Just run the command line as administrator and enter it.

 easy_install python-dateutil 
0
Jan 9 '14 at 22:58
source share

You can also change your PYTHONPATH:

 $ python -c 'import dateutil' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: No module named dateutil $ $ PYTHONPATH="/usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg":"${PYTHONPATH}" $ export PYTHONPATH $ python -c 'import dateutil' $ 

Where /usr/lib/python2.6/site-packages/python_dateutil-1.5-py2.6.egg is the dateutil place set in my field (centos using sudo yum install python-dateutil15 )

0
Oct. 29 '14 at 9:32
source share

First, confirm that you have the dateutil folder in C: / python ## / Lib / Site-packages /, you may have downloaded it, you already have pip, matplotlib, six ##, confirm that you installed dateutil by - - go to cmd, cd / python, you should have a folder / scripts. cd to Scripts, then type --pip install python-dateutil - ---- This applies to Windows 7 Ultimate 32bit, Python 3.4 ------

0
Apr 26 '15 at 13:46
source share

I have made several suggestions on this list without success. Finally, it was installed on Windows using this method: I extracted the zip file and put the folders in the python27 folder. In the DOS window, I went to the installed root folder of the zip file extraction ( python-dateutil-2.6.0 ), and then issued the following command:

 .\python setup.py install 

Whammo-bammo it all worked.

0
Dec 6 '16 at 19:10
source share



All Articles