当scripts目录下有多个py模块文件时,python文件会提示下面错误,怎么解决这个问题,试了各种方法不行。
包括增加sys.path.appent(''),
使用init.py可以临时解决,但是如果其他插件也是在scripts目录有多个问题,第一个使用的有效,其他的就不能使用
*** Error loading script: state_api.py
Traceback (most recent call last):
File "/mnt/p/home/flyang/stable-diffusion-webui/modules/scripts.py", line 381, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/mnt/p/home/flyang/stable-diffusion-webui/modules/script_loading.py", line 12, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/mnt/p/home/flyang/stable-diffusion-webui/extensions/LightDiffusionFlow/scripts/state_api.py", line 26, in
from scripts import lightdiffusionflow_version, lightdiffusionflow_config
ImportError: cannot import name 'lightdiffusionflow_version' from 'scripts' (/home/flyang/.local/lib/python3.10/site-packages/scripts/init.py)
*** Error loading script: state_settings.py
Traceback (most recent call last):
File "/mnt/p/home/flyang/stable-diffusion-webui/modules/scripts.py", line 381, in load_scripts
script_module = script_loading.load_module(scriptfile.path)
File "/mnt/p/home/flyang/stable-diffusion-webui/modules/script_loading.py", line 12, in load_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/mnt/p/home/flyang/stable-diffusion-webui/extensions/LightDiffusionFlow/scripts/state_settings.py", line 4, in
from scripts.lightdiffusionflow_config import OutputPrompt
ModuleNotFoundError: No module named 'scripts.lightdiffusionflow_config'
当scripts目录下有多个py模块文件时,python文件会提示下面错误,怎么解决这个问题,试了各种方法不行。 包括增加sys.path.appent(''), 使用init.py可以临时解决,但是如果其他插件也是在scripts目录有多个问题,第一个使用的有效,其他的就不能使用 *** Error loading script: state_api.py Traceback (most recent call last): File "/mnt/p/home/flyang/stable-diffusion-webui/modules/scripts.py", line 381, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/mnt/p/home/flyang/stable-diffusion-webui/modules/script_loading.py", line 12, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/mnt/p/home/flyang/stable-diffusion-webui/extensions/LightDiffusionFlow/scripts/state_api.py", line 26, in
from scripts import lightdiffusionflow_version, lightdiffusionflow_config
ImportError: cannot import name 'lightdiffusionflow_version' from 'scripts' (/home/flyang/.local/lib/python3.10/site-packages/scripts/init.py)
*** Error loading script: state_settings.py Traceback (most recent call last): File "/mnt/p/home/flyang/stable-diffusion-webui/modules/scripts.py", line 381, in load_scripts script_module = script_loading.load_module(scriptfile.path) File "/mnt/p/home/flyang/stable-diffusion-webui/modules/script_loading.py", line 12, in load_module module_spec.loader.exec_module(module) File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/mnt/p/home/flyang/stable-diffusion-webui/extensions/LightDiffusionFlow/scripts/state_settings.py", line 4, in
from scripts.lightdiffusionflow_config import OutputPrompt
ModuleNotFoundError: No module named 'scripts.lightdiffusionflow_config'