A dateutil error has appeared, due to updates? How to fix?

tinnews at isbd.co.uk tinnews at isbd.co.uk
Sun Sep 23 11:26:27 EDT 2012


Peter Otten <__peter__ at web.de> wrote:
> tinnews at isbd.co.uk wrote:
> 
[snip description of problem]

> > Have I lost a module somewhere in the updates or has something in
> > python changed such that my code no longer works as it used to?
> > 
> > Can anyone help diagnose this please.
> 
> You probably have a file named calendar.py in your working directory:
> 
> $ python -c 'from dateutil.relativedelta import calendar; print 
> calendar.__file__'
> /usr/lib/python2.7/calendar.pyc
> $ touch calendar.py
> $ python -c 'from dateutil.relativedelta import calendar; print 
> calendar.__file__'
> calendar.py
> 
> Rename calendar.py in your working directory (and don't forget to delete the 
> corresponding calendar.pyc) -- and dateutil should work again.
> 
Brilliant, you're absolutely right!  Thank you!  :-)

I'd written calendar.py doing something else entirely.  I must
remember not to use such 'obvious' names for things!

-- 
Chris Green



More information about the Python-list mailing list