stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

Errors and warnings with fresh new install

Open TaciteOFF opened this issue 3 years ago • 7 comments

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 "", line 2, in File "", line 34, in File "/private/tmp/pip-install-53ue6kjn/onnx_6ebd2ba7e7ef4aa4a338b78f6a31e6aa/setup.py", line 81, in assert CMAKE, "Could not find cmake executable!" AssertionError: Could not find cmake executable! [end of output]

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.

TaciteOFF avatar Oct 13 '22 14:10 TaciteOFF

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 '

TaciteOFF avatar Oct 13 '22 14:10 TaciteOFF

I got the same ModuleNotFoundError: No module named 'jsonmerge' How did you manage to install jsonmerge by yourself? Thanks!

neerhow avatar Oct 14 '22 11:10 neerhow

I did "pip3 install jsonmerge" in terminal

TaciteOFF avatar Oct 14 '22 17:10 TaciteOFF

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.

BrassHead avatar Oct 16 '22 05:10 BrassHead

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.

TaciteOFF avatar Oct 16 '22 12:10 TaciteOFF

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!

neorrk avatar Oct 17 '22 05:10 neorrk

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.

dylanjaybaxter avatar Nov 10 '22 05:11 dylanjaybaxter

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.sh to add a line that tries to install the required dependencies with pip install -r requirements.txt each 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 deactivate

Originally 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.txt didn't work for them, or finding that despite pip installing the individual requirements they still don't seem to 'be there', it might be an issue with your conda environment, and which pip is 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/pip

And not something like:

/opt/conda/envs/web-ui/bin/pip
/opt/conda/bin/pip

Then you can likely fix it by either doing a conda install pip then using pip as normal, or using python -m pip install FOO instead of using pip directly.

Originally posted by @0xdevalias in https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/4109#issuecomment-1308357941

I did a conda install pip and then used python -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.txt rather than requirements.txt?

python -m pip install -r requirements_versions.txt

Originally 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

0xdevalias avatar Nov 14 '22 21:11 0xdevalias

Closing as stale.

catboxanon avatar Aug 03 '23 16:08 catboxanon