stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Errors and warnings with fresh new install
Hello,
Some warnings and error appear after I install for the first time on my new Macbook Pro M1
` Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.`
Also :
Traceback (most recent call last): File "/Users/tom/Downloads/stable-diffusion-webui/webui.py", line 12, in <module> from modules import devices, sd_samplers File "/Users/tom/Downloads/stable-diffusion-webui/modules/sd_samplers.py", line 7, in <module> import k_diffusion.sampling File "/Users/tom/Downloads/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/__init__.py", line 1, in <module> from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils File "/Users/tom/Downloads/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/config.py", line 6, in <module> from jsonmerge import merge ModuleNotFoundError: No module named 'jsonmerge'
Thank you.
I managed to install jsonmerge by myself. The first generated image worked fine (even though it's very slow), but when I tried a batch of 2 images, it closed with this error:
/AppleInternal/Library/BuildRoots/a0876c02-1788-11ed-b9c4-96898e02b808/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:705: failed assertion `[MPSTemporaryNDArray initWithDevice:descriptor:] Error: product of dimension sizes > 2**31' ./run_webui_mac.sh: line 13: 29883 Abort trap: 6 python webui.py --precision full --no-half --use-cpu GFPGAN CodeFormer BSRGAN ESRGAN SCUNet $@ /Users/tom/miniconda/envs/web-ui/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d '
I got the same ModuleNotFoundError: No module named 'jsonmerge' How did you manage to install jsonmerge by yourself? Thanks!
I did "pip3 install jsonmerge" in terminal
Installing jsonmerge just lead to getting more module not found errors.
I noticed that the onnx package had trouble installing because it could not find cmake (this error was much earlier in the output from setup_mac.sh). Homebrew puts cmake in /opt/homebrew/bin/ . The fix for me was to add a link in a more standard place with
sudo ln -s /opt/homebrew/bin/cmake /usr/local/bin/cmake
and then restart terminal. After that setup_mac.sh ran to completion and the web_ui server started.
After a format of my Macbook, I tried to reinstall. The "jsonmerge" error was still appearing at first setup. I did your link command and retried, rebooted, restarted the install, same error. I tried to install manually json merge, rebooter, restarted the install, same error.
bash -l -c "conda activate web-ui; pip install jsonmerge einops clean-fid resize_right torchdiffeq lark gradio fastapi omegaconf piexif fonts font-roboto pytorch_lightning transformers kornia realesrgan scunet timm"
This has worked for me!
I resolved this by adding
run(f'"{python}" -m pip install --upgrade pip setuptools', "Upgrading pip", "Couldn't install torch")
if not is_installed("jsonmerge"):
run(f'"{python}" -m pip install jsonmerge==1.8.0', "Installing jsonmerge", "Couldn't install jsonmerge")
to the prepare_environment method in launch.py.
The issue was that the venv setup uses a version of pip that does not install jsonmerge or font_roboto properly. It only creates the dist-info folder, and not the actual package, so it looks like it is installed but its not.
Not sure if this will work for your specific issue here, but I suspect that it possibly will:
You can modify your
run_webui_mac.shto add a line that tries to install the required dependencies withpip install -r requirements.txteach time it starts, after it pulls the latest code. This would probably make a sensible default, and is fairly quick to run, so it might be worth someone telling the original author to include it in their setup script to avoid this sort of error for end users in future:Here is what mine looks like:
#!/usr/bin/env bash -l pyenv local anaconda3-2022.05 # This should not be needed since it's configured during installation, but might as well have it here. conda env config vars set PYTORCH_ENABLE_MPS_FALLBACK=1 # Activate conda environment conda activate web-ui # Pull the latest changes from the repo git pull --rebase + # Update the dependencies if needed + pip install -r requirements.txt # Run the web ui python webui.py --deepdanbooru --precision full --no-half --use-cpu Interrogate GFPGAN CodeFormer $@ # Deactivate conda environment conda deactivateOriginally posted by @0xdevalias in https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4109#issuecomment-1304747007
For the others who said that
pip install -r requirements.txtdidn't work for them, or finding that despitepip installing the individual requirements they still don't seem to 'be there', it might be an issue with yourcondaenvironment, and whichpipis being used. Sometimes the version you're calling doesn't actually install the packages to the correct place, and so they can't be found later.I have a new theory for you, based on this StackOverflow:
- https://stackoverflow.com/questions/41060382/using-pip-to-install-packages-to-anaconda-environment
What do you see when you activate your conda environment, then run
which -a pip?If it's only something like:
/opt/conda/bin/pipAnd not something like:
/opt/conda/envs/web-ui/bin/pip /opt/conda/bin/pipThen you can likely fix it by either doing a
conda install pipthen usingpipas normal, or usingpython -m pip install FOOinstead of usingpipdirectly.Originally posted by @0xdevalias in https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4109#issuecomment-1308357941
I did a
conda install pipand then usedpython -m, it looked like it wasn't going to work but then I changed my run script a tiny bit,Curious, what made you think it wasn't going to work? And what was the specific change to the run script that made it work for you? Was it using
requirements_versions.txtrather thanrequirements.txt?python -m pip install -r requirements_versions.txtOriginally posted by @0xdevalias in https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4109#issuecomment-1309356932
Hopefully the above helps people who are still running into this issue 🖤
Originally posted by @0xdevalias in https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4061#issuecomment-1314398808
Closing as stale.