Timezone Information Missing in pytz?

后端 未结 8 1546
轻奢々
轻奢々 2020-12-31 16:17

I\'m having a very weird problem with Python\'s pytz: it seems to have an incomplete catalog of timezones on my system (MacOS X 10.8.5, system Python 2.7.5).

8条回答
  •  囚心锁ツ
    2020-12-31 17:04

    I had a similar exception UnknownTimeZoneError: Can not find any timezone configuration when i tried to run my app inside a docker container with the latest ubuntu images. It turned out that tzdata was missing. Installing tzdata package fixed it:

    apt-get install -y tzdata
    
    # Maybe you will need to reconfigure the timezone as well:
    ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
    dpkg-reconfigure -f noninteractive tzdata
    

    (Use sudo if you have to)

提交回复
热议问题