Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

problem with pyinstaller. 'NoneType' object has no attribute 'isatty' #879

Open
cmnewfan opened this issue May 25, 2023 · 1 comment
Open

Comments

@cmnewfan
Copy link

the program works fine when using python command in cmd, but when using pyinstaller, the exe file throws exception.

Traceback (most recent call last):
File "Model_External_Filed_Test.py", line 212, in
File "gooey\python_bindings\gooey_decorator.py", line 128, in inner2
File "Model_External_Filed_Test.py", line 46, in start
File "gooey\python_bindings\gooey_parser.py", line 125, in parse_args
File "gooey\python_bindings\gooey_decorator.py", line 123, in run_gooey
File "gooey\gui\application.py", line 21, in run
File "gooey\gui\application.py", line 27, in build_app
File "gooey\gui\application.py", line 40, in _build_app
File "gooey\gui\containers\application.py", line 47, in init
File "gooey\gui\components\console.py", line 20, in init
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
File "gooey\gui\components\widgets\richtextconsole.py", line 3, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
File "colored_init
.py", line 7, in
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
File "colored\colored.py", line 12, in
AttributeError: 'NoneType' object has no attribute 'isatty'

the line 46 in start is parser.parse_args()

@keymou
Copy link

keymou commented Jun 12, 2023

I had the same problem, I modified the colored.py, Temporarily solved by temporary assignment, the project will not be affected temporarily。

try:
    IS_TTY = sys.stdout.isatty() and sys.stderr.isatty()
except AttributeError:
    IS_TTY = False

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants