56

I have successfully installed matplotlib with python 2.6 on x64 Windows7. When I try to import matplotlib, it shows the following error. I have also installed numpy following this link: Installing Numpy on 64bit Windows 7 with Python 2.7.3

import matplotlib.pyplot as plt

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    import matplotlib.pyplot as plt
  File "C:\Python26\Lib\site-packages\matplotlib\__init__.py", line 110, in <module>
    raise ImportError("matplotlib requires dateutil")
ImportError: matplotlib requires dateutil

How can I make it work?

I installed matplotlib-1.3.0.win-amd64-py2.6.exe from http://matplotlib.org/downloads.html

Community
  • 1
  • 1
user2690469
  • 581
  • 1
  • 4
  • 5
  • install `dateutil`. What version of `mpl` are you using? There was recently change in how `mpl` deals with external dependencies (shipping them vs installing them). Please include details of _exactly_ how you installed `mpl`. – tacaswell Aug 16 '13 at 19:27
  • Did you follow the directions [here](http://matplotlib.org/users/installing.html)? – tacaswell Aug 16 '13 at 19:28
  • I had a similar issue where I wanted to use matplotlib together with PySide instead of PyQt and that also changed the import which are needed. However by default the backend matplotlib.backends.backend_qt4agg is PyQt, for PySide it needs to be changed (for example in matplotlibrc). – NoDataDumpNoContribution Mar 17 '14 at 15:27

2 Answers2

66

Here's a list of the programs you can install on windows:

http://www.lfd.uci.edu/~gohlke/pythonlibs/

And you'll need the following dependencies: Requires numpy, dateutil, pytz, pyparsing, six

takrliu
  • 736
  • 6
  • 7
  • 23
    On Os X, `sudo pip install numpy python-dateutil pytz pyparsing six --force-reinstall --upgrade` did it for me, thanks :) – GabLeRoux Feb 07 '14 at 19:00
  • 2
    This list of binaries has really made my life easy using python on Win7 64 bit! – TKoL May 03 '14 at 13:02
  • On windows, you skip the sudo part... just open cmd and do... pip install numpy python-dateutil pytz pyparsing six – JoeBass Sep 16 '15 at 16:48
56

You're probably looking for:

pip install python-dateutil
David Wolever
  • 148,955
  • 89
  • 346
  • 502