I am trying to run a program using paster serve
, but I keep getting the error:
ImportError: No module named dateutil.relativedelta
(The previous comment about installing python-dateutil helped me, so perhaps my comment helps someone else).
For those on Mac OS (v10.6 (Snow Leopard); I am not sure about other versions), the dateutils package is located by default at:
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/dateutil
whereas pip install writes the package out to:
/Library/Python/2.6/site-packages
and does not update the /Library/Python/2.6/site-packages/easy-install.pth file. As a result, when you import dateutil, you will still point to the old location, you can verify this by "import dateutil; dateutil.__file__
".
So what I did (probably better methods are available) was to rename the old directory (/System/Library/.../dateutil
) to dateutil.obsolete
and restarted Python, then ran the same set of commands again. This doesn't do anything to the path file or sys.path
, but skips the old dateutils package so you can get to the new one.