Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: No "jsonmerge" installed using the windows installation method - solution included. #12482

Open
1 task done
RandomInternetPreson opened this issue Aug 11, 2023 · 8 comments
Labels
asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance upstream Issue or feature that must be resolved upstream

Comments

@RandomInternetPreson
Copy link

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

I've seen people mention something similar to this in the issue tracker, but I think this is maybe a different issue and I haven't seen a widows install specific solution? Okay so if I have python 3.10.6 installed, the initial installation of Auto1111 does not include the "jsonmerge" folder it ONLY installs the "jsonmerge-1.8.0.dist-info" folder.

So the program will not start.

However, if I have python 3.11.4 installed, both folders are installed as necessary and Auto1111 seems to run. I am hesitate to run it in this configuration as it was not intended to run with this version of python (as indicated on the front page of the repo).

So I have taken the two folders worth of contents from the installation that used python 3.11.4 and put them in the installation that used python 3.10.6 and things seem to be working now.

I had tried various pip techniques and could not get the "jsonmerge" folder to install correctly.

Steps to reproduce the problem

I just built a new machine and followed the instructions on the front page of the repo. I have done the suggested installation many times without fail on a previous machine.

What should have happened?

Auto1111 should have installed the "jsonmerge" folder, it only installed the "jsonmerge-1.8.0.dist-info" folder

Version or Commit where the problem happens

newest official release and the current repo version

What Python version are you running on ?

Python 3.10.x

What platforms do you use to access the UI ?

Windows

What device are you running WebUI on?

Nvidia GPUs (RTX 20 above)

Cross attention optimization

Automatic

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

No

List of extensions

No

Console logs

Resolving deltas: 100% (287/287), done.
Cloning BLIP into L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\repositories\BLIP...
Cloning into 'L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\repositories\BLIP'...
remote: Enumerating objects: 277, done.
remote: Counting objects: 100% (165/165), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 277 (delta 137), reused 136 (delta 135), pack-reused 112
Receiving objects: 100% (277/277), 7.03 MiB | 11.18 MiB/s, done.

Resolving deltas: 100% (152/152), done.
Installing requirements for CodeFormer
Installing requirements
Launching Web UI with arguments:
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Traceback (most recent call last):
  File "L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\launch.py", line 39, in <module>
    main()
  File "L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\launch.py", line 35, in main
    start()
  File "L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\modules\launch_utils.py", line 390, in start
    import webui
  File "L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\webui.py", line 61, in <module>
    from modules import shared, sd_samplers, upscaler, extensions, localization, ui_tempdir, ui_extra_networks, config_states
  File "L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\modules\sd_samplers.py", line 1, in <module>
    from modules import sd_samplers_compvis, sd_samplers_kdiffusion, shared
  File "L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\modules\sd_samplers_kdiffusion.py", line 4, in <module>
    import k_diffusion.sampling
  File "L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\repositories\k-diffusion\k_diffusion\__init__.py", line 1, in <module>
    from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils
  File "L:\StableDiffusionAug11\stable-diffusion-webui-1.5.1\repositories\k-diffusion\k_diffusion\config.py", line 6, in <module>
    from jsonmerge import merge
ModuleNotFoundError: No module named 'jsonmerge'
Press any key to continue . . .

Additional information

Really like the software, thanks!

@RandomInternetPreson RandomInternetPreson added the bug-report Report of a bug, yet to be confirmed label Aug 11, 2023
@catboxanon catboxanon added asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance and removed bug-report Report of a bug, yet to be confirmed labels Aug 11, 2023
@catboxanon
Copy link
Collaborator

catboxanon commented Aug 11, 2023

I'll temporarily leave this open but I'll mention I can't reproduce this, and this is after doing a fresh venv install as of yesterday on the latest dev branch commit with Python 3.10.6. Your solution would work but it indicates something else is going wrong and I wouldn't recommend that as a permanent fix.

@akx
Copy link
Collaborator

akx commented Sep 1, 2023

related: crowsonkb/k-diffusion#73

@catboxanon catboxanon added the upstream Issue or feature that must be resolved upstream label Sep 1, 2023
@john-0u0
Copy link

I've encountered the same problem. After 2 hours' trying I deleted the folder jsonmerge-1.8.0.dist-info and cached file jsonmerge-1.8.0-py3-none-any.whl then reinstalled jsonmerge (by modifying the code in launch_utils.py while you can also find other ways) and solved the problem. Then came the basicsr problem and I solved it with another reinstall.

Installed & cached modules could lead to fatal problems which can be got through by merely reinstalling them! That's terrible. I don't think common users with less knowledge in scripts and programming could solve this. I really hope the maintainers could update the setup scripts to improve robustness.

@lcmiracle
Copy link

I had the same issue after migrating to a new PC (but the cards are different generations so I re-installed venv). Kept getting the no jsonmerge error. I thought it was disk privilege issues but no dice. The most weird part was I open the project in pycharm, which I used as Git manager, and tried to run webui.py inside. It always says no JsonMerge even though I installed the package several times within Pycharm

Just tried what @john-0u0 wrote I went to Appdata/local/pip/cache or something and looked into the cache folders until I find the jsonmerge cached file. Delete and used Pycharm to open the SD folder, reinstalling Jsonmerge seems to have done it (it's downloading SD1.5 and XL as I type, so passed the JSONMerge error part. Looks to be a corrupted package issue in my case.

@yanxiaodi
Copy link

I got the same error when I reinstalled sd-webui. Just deleted the venv folder and retried a few times then the error was gone.

@fsdtking
Copy link

fsdtking commented Apr 25, 2024

At the entry file I solved it like this.
launch.py added

import sys, os
// Set the correct site-packages folder path into the environment variable
sys.path.append("E:\\anaconda3\\envs\\sd\\lib\\site-packages")

@malaire
Copy link

malaire commented Jun 11, 2024

I got same error today. Fresh (first-ever) install on Windows 11 using instructions at Install-and-Run-on-NVidia-GPUs, i.e. download sd.webui.zip, run update.bat, run run.bat.

After downloading some stuff it crashes with ModuleNotFoundError: No module named 'jsonmerge'.

UPDATE: I also tried "method 2" there, i.e. global install of Python and git and then clone repository, but that doesn't work either and gives same error.

@malaire
Copy link

malaire commented Jun 11, 2024

ok, looks like webui-user.bat tries to install required jsonmerge but for some reason installs broken package which doesn't work (site-packages will have jsonmerge-1.8.0.dist-info directory but no jsonmerge directory).

I don't know why this happens, and note that this is with clean Windows 11 install in which Python has not been used at all before.

Following fixes this for me (when using "method 2" i.e. with global Python and git): In Command Prompt go to the installation directory and then run following:
.\venv\Scripts\activate.bat
pip uninstall jsonmerge
pip install jsonmerge=1.8.0 --no-cache-dir

  • uninstall is required to first remove broken package
  • installed version must be exactly 1.8.0, otherwise webui-user.bat will remove the version I installed and install broken 1.8.0 instead
  • --no-cache-dir is required or otherwise broken package is installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asking-for-help-with-local-system-issues This issue is asking for help related to local system; please offer assistance upstream Issue or feature that must be resolved upstream
Projects
None yet
Development

No branches or pull requests

8 participants