If I write
import datetime
if I write
from datetime import timezone
I get the error ImportError: cannot import name timezone
Of course calling datetime.timezone
does not work either.
How do I debug this? I have wasted an hour and it is already late here.
datetime.py
under the same directory? – Bubble Bubble Bubble Gut May 31 '18 at 0:54sys.path
. – Bubble Bubble Bubble Gut May 31 '18 at 0:56timezone
is not a standard python module. Perhaps you meanpytz.timezone
(you'll have to install pytz) ordatetime.tzinfo
? – Seth May 31 '18 at 1:00from datetime import timezone
is valid in python3 but not python2. I'm not sure what the replacement is. – TrewTzu May 31 '18 at 1:04