Skip to content

AttributeError: 'NoneType' object has no attribute 'flush' #3290

@Xvareon

Description

@Xvareon

Describe the bug

I have a python program that I have converted into an exe file using PyInstaller. I have the latest versions of Diffusers and Transformers library which are 0.16.1 and 4.28.1 respectively. When I run the exe file, I get this error: AttributeError: 'NoneType' object has no attribute 'flush'. But when I am running the python file, its working fine.

Reproduction

Run the exe file, and an error window will show. More details on the error on the logs I have provided.

Logs

Traceback (most recent call last):
  File "app.py", line 36, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
  File "diffusers\__init__.py", line 3, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
  File "diffusers\configuration_utils.py", line 34, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
  File "diffusers\utils\__init__.py", line 21, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
  File "diffusers\utils\accelerate_utils.py", line 20, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller\loader\pyimod02_importers.py", line 352, in exec_module
  File "diffusers\utils\import_utils.py", line 38, in <module>
  File "diffusers\utils\logging.py", line 121, in get_logger
  File "diffusers\utils\logging.py", line 85, in _configure_library_root_logger
AttributeError: 'NoneType' object has no attribute 'flush'

System Info

Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleIssues that haven't received updates

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions