pegler / pytzwhere

python library to look up timezone from lat lng offline
Other
146 stars 54 forks source link

tz_world.json.gz does not exits #48

Closed ulfaslak closed 7 years ago

ulfaslak commented 7 years ago

Immediately after a fresh pip2 install I do:

from tzwhere import tzwhere
tzwhere.tzwhere()

I get the error (subset below):

/opt/conda/envs/python2/lib/python2.7/gzip.pyc in __init__(self, filename, mode, compresslevel, fileobj, mtime)
     92             mode += 'b'
     93         if fileobj is None:
---> 94             fileobj = self.myfileobj = __builtin__.open(filename, mode or 'rb')
     95         if filename is None:
     96             # Issue #13781: os.fdopen() creates a fileobj with a bogus name

IOError: [Errno 2] No such file or directory: '/opt/conda/envs/python2/lib/python2.7/site-packages/tzwhere/tz_world.json.gz'

It looks like gzip is trying to locate tz_world.json.gz. It does not exist inside the tzwhere folder, which includes only:

tzwhere.py                                                 
tzwhere.pyc                                                
tz_world_shortcuts.json

If I manually add the file to the directory it works. So it just seems that it is something in the pip installation that goes wrong.

pegler commented 7 years ago

just pushed version 3.0.3 that should fix this