I am currently making a game using pygame module. I have followed the following links\' directions. https://pythonprogramming.net/converting-pygame-executable-cx_freeze/
A simple approach but not elegant can be to place
if not True: import codecs
somewhere in your code.