AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
139.87k stars 26.5k forks source link

[Bug]: AttributeError: partially initialized module 'modules.sysinfo' has no attribute 'format_exception' (most likely due to a circular import) #13346

Open kishorekrazzy opened 12 months ago

kishorekrazzy commented 12 months ago

Is there an existing issue for this?

What happened?

From yestraday not opening

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

From yestraday not opening

Sysinfo

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] Version: v1.6.0 Commit hash: 5ef669de080814067961f28357256e8fe27544f4 Traceback (most recent call last): File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 244, in list_extensions settings = json.load(file) File "C:\Users\KISHORE\AppData\Local\Programs\Python\Python310\lib\json__init__.py", line 293, in load return loads(fp.read(), File "C:\Users\KISHORE\AppData\Local\Programs\Python\Python310\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8a in position 7: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 244, in list_extensions settings = json.load(file) File "C:\Users\KISHORE\AppData\Local\Programs\Python\Python310\lib\json__init__.py", line 293, in load return loads(fp.read(), File "C:\Users\KISHORE\AppData\Local\Programs\Python\Python310\lib\codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8a in position 7: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\system\pictures\AI\stable-diffusion-webui\launch.py", line 48, in main() File "D:\system\pictures\AI\stable-diffusion-webui\launch.py", line 39, in main prepare_environment() File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 400, in prepare_environment run_extensions_installers(settings_file=args.ui_settings_file) File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 262, in run_extensions_installers for dirname_extension in list_extensions(settings_file): File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 246, in list_extensions errors.report("Could not load settings", exc_info=True) File "D:\system\pictures\AI\stable-diffusion-webui\modules\errors.py", line 29, in report record_exception() File "D:\system\pictures\AI\stable-diffusion-webui\modules\errors.py", line 17, in record_exception from modules import sysinfo File "D:\system\pictures\AI\stable-diffusion-webui\modules\sysinfo.py", line 13, in from modules import paths_internal, timer, shared, extensions, errors File "D:\system\pictures\AI\stable-diffusion-webui\modules\shared.py", line 5, in from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types File "D:\system\pictures\AI\stable-diffusion-webui\modules\shared_cmd_options.py", line 9, in script_loading.preload_extensions(extensions_dir, parser, extension_list=launch.list_extensions(launch.args.ui_settings_file)) File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 246, in list_extensions errors.report("Could not load settings", exc_info=True) File "D:\system\pictures\AI\stable-diffusion-webui\modules\errors.py", line 29, in report record_exception() File "D:\system\pictures\AI\stable-diffusion-webui\modules\errors.py", line 18, in record_exception exception_records.append(sysinfo.format_exception(e, tb)) AttributeError: partially initialized module 'modules.sysinfo' has no attribute 'format_exception' (most likely due to a circular import)

What browsers do you use to access the UI ?

Google Chrome

Console logs

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Traceback (most recent call last):
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 244, in list_extensions
    settings = json.load(file)
  File "C:\Users\KISHORE\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\KISHORE\AppData\Local\Programs\Python\Python310\lib\codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8a in position 7: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 244, in list_extensions
    settings = json.load(file)
  File "C:\Users\KISHORE\AppData\Local\Programs\Python\Python310\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\KISHORE\AppData\Local\Programs\Python\Python310\lib\codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8a in position 7: invalid start byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\system\pictures\AI\stable-diffusion-webui\launch.py", line 48, in <module>
    main()
  File "D:\system\pictures\AI\stable-diffusion-webui\launch.py", line 39, in main
    prepare_environment()
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 400, in prepare_environment
    run_extensions_installers(settings_file=args.ui_settings_file)
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 262, in run_extensions_installers
    for dirname_extension in list_extensions(settings_file):
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 246, in list_extensions
    errors.report("Could not load settings", exc_info=True)
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\errors.py", line 29, in report
    record_exception()
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\errors.py", line 17, in record_exception
    from modules import sysinfo
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\sysinfo.py", line 13, in <module>
    from modules import paths_internal, timer, shared, extensions, errors
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\shared.py", line 5, in <module>
    from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\shared_cmd_options.py", line 9, in <module>
    script_loading.preload_extensions(extensions_dir, parser, extension_list=launch.list_extensions(launch.args.ui_settings_file))
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\launch_utils.py", line 246, in list_extensions
    errors.report("Could not load settings", exc_info=True)
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\errors.py", line 29, in report
    record_exception()
  File "D:\system\pictures\AI\stable-diffusion-webui\modules\errors.py", line 18, in record_exception
    exception_records.append(sysinfo.format_exception(e, tb))
AttributeError: partially initialized module 'modules.sysinfo' has no attribute 'format_exception' (most likely due to a circular import)

Additional information

Help me with this problem

gerard-or commented 11 months ago

I have the same problem, install uninstall webui/python doesn't help. It happened even without any extensions installed!

Stalindubz commented 11 months ago

I have the same problem, were you able to solve it?

umutyas commented 11 months ago

same problem.. please help me

NinePT commented 11 months ago

for me its has something to do with the reactor extension, i installed and couldnt start a1111, deleted the reactor extension folder, and starts up fine

stokemctoke commented 10 months ago

Same here. If I delete the venv folder then restart it fixes it but this is a lengthy process just to restart as it reinstall full environment.

gillopillo commented 10 months ago

same problem here

licyk commented 10 months ago

I try to remove config.json and then solve this problem.