Timezone Information Missing in pytz?

后端 未结 8 1620
轻奢々
轻奢々 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 cannot say why your installation of pytz is broken, but here's a possible fix:

    1. Download the .zip archive of pytz from the Python Package Index.
    2. In Terminal.app, run pip show pytz.
    3. Using the path it returns, run open /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (replacing my path with yours if different). This will launch a Finder window with your Python modules.
    4. Find the pytz/ folder. Open it.
    5. Replace the zoneinfo/ folder with the zoneinfo/ folder that's in the .zip archive you downloaded in step 1 from PyPI.

提交回复
热议问题