six inclusion for dateutil on py3 doesn't work #1154

merged 1 commit into from Aug 28, 2012

2 participants


I just installed the current HEAD to a fresh python3 install. It all installs fine, but if I try to do ipython --pylab, I get this ImportError:

/usr/local/Cellar/python3/3.2.3/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/dateutil/ in <module>()
     16 import sys
---> 18 from six import advance_iterator, integer_types
     20 __all__ = ["rrule", "rruleset", "rrulestr",

ImportError: No module named six

The introduced in lib/dateutil_py3 in 07d8416 is included in my site-packages/dateutil folder, but the attempted relative import doesn't work (thanks to PEP 328).

To solve this, matplotlib should install six directly into site-packages when on python 3 if not already present, or alternatively change all six imports in dateutil to from .six import ....

(An easy workaround for users is of course to pip install six or pip install python-dateutil, which includes six as a dependency.)

Matplotlib Developers member

Sorry -- that's just a big oops on my part. I will fix this before the upcoming release.

@mdboom mdboom was assigned Aug 27, 2012

No worries, it's obviously easy to work around, just wanted to make sure it didn't make it into the release. :)

@mdboom mdboom Install six as a proper top-level package. Fix some other minor and r…
…elated issues related to installing dateutil and pytz on Python 3.
Matplotlib Developers member

@dougalsutherland : Can you check that the attached PR resolves the issue for you?


Yep, works for me.

@mdboom mdboom merged commit 8cefc3f into matplotlib:master Aug 28, 2012
@mdboom mdboom deleted the mdboom:fix_six branch Mar 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment