Unhandled exception in script

Using pycharm I can run and use the app but when converting .py to .exe I get error:

NoneType object has no attribute ‘write’

Traceback (most recent call last):
File “main.py”, line 6, in
File “pip_init_.py”, line 13, in main
File “pip_internal\utils\entrypoints.py”, line 35, in _wrapper
AttributeError: ‘NoneType’ object has no attribute ‘write’

I’ve never tried what you’re trying to do, so this is a shot in the dark…

Do you have a shebang as line 1 of your code?