ImportError: cannot import name timegm

GAE/Pthonでこんなエラーが出た。

from calendar import timegm
ImportError: cannot import name timegm

色々調べてみてわかったのが、「calendar.py」という名前でモジュールを作ったところcalendarライブラリと勘違いして読み込んだらしい。
「calendar.py」を「calendar_xxx.py」 みたいな名前にしてソースをEclipseの右クリックメニューから「Refresh」し、もう一度やり直したら出なくなった。

Leave a Reply

Your email address will not be published. Required fields are marked *