Pytz does not compile correctly when using Pyinstaller

python 2.7.11

the script uses pytz, using Pyinstaller, it was compiled into an executable file ..exe works fine from my computer; however, when opened by someone else, they encountered this error:

Traceback <most recent call last>:
File "<string>", line 258, in module
File "<string>", line 20, in init
File "site-packages\pytz_init_.py, line 180, in timezone pytz.exceptions.UnknownTimeZoneError:'US/Pacific'    

Error code:

self.pacific = pytz.timezone('US/Pacific')

The line immediately before this self.UTC = pytz.timezone('UTC')does not cause errors.

Pyinstaller is equipped to handle Pytz, and when it is compiled, it created the pytz folder, which contains the zoneinfo folder, which should contain all the necessary files.

Since it worked on my machine (which has pytz installed), and not on their machine (which does not have pytz installed), it is possible that it is looking for the info zone in the wrong place, but I'm not sure how to fix this error.

+4

All Articles