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

[Bug]: Manual installation of dependencies doesnt work

Open nagaisa opened this issue 2 years ago • 3 comments

Is there an existing issue for this?

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

What happened?

Installing requirements gives this error

Steps to reproduce the problem

  1. run python3.10 -m pip install -r requirements.txt
  2. wait for it to finish
  3. Everything installs and downgrades/upgrades to right versions

What should have happened?

some dependencies need to have different versions of same package, shold use versions that are all compatable with eatch other

Commit where the problem happens

n/a

What platforms do you use to access UI ?

Linux

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

--xformers --opt-split-attention --medvram --deepdanbooru

Additional information, context and logs

will edit this latter but im in a rush rn so sorry for bad formateing

nagaisa avatar Jan 10 '23 17:01 nagaisa

You're not meant to install dependencies this way, https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs#linux . It's done automatically, because there's a lot of border cases, systems, versions and models to support, and this repo tries to be friendly for unexperienced users. If you still want to do it manually, then i suggest checking https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/50fb20cedc8dcbf64f86aed6d6e89595d655e638/launch.py#L175

mezotaken avatar Jan 10 '23 18:01 mezotaken

https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs#manual-installation Here's more convenient form, but says it is outdated.

mezotaken avatar Jan 12 '23 10:01 mezotaken

I have no idea what I am doing, not a coder but I was trying to fix my stuff that I messed up worse trying to make deforum, animator and prompt travel work and I found this and got a list, changed the requirements.txt file just to see if it would help. Didn't fix the animation issues but the image gen is working great. Seems better actually. My thought was could it just be an automatic check '-m pip freeze' and then rewrites the requirements text unless it finds a conflict? Like if there is an error starting it keeps a copy of the last working requirements and reverts somehow and a button in the ui if something stops working to revert to the last set? I hope I don't sound like too much of an idiot. lol

python -m pip freeze will produce a list of the installed packages, the output uses the format that python -m pip install expects. A common convention is to put this list in a requirements.txt file:

absl-py==1.3.0 accelerate==0.15.0 aiohttp==3.8.3 aiosignal==1.3.1 albumentations==1.3.0 antlr4-python3-runtime==4.9.3 astunparse==1.6.3 async-timeout==4.0.2 attrs==22.2.0 cachetools==5.2.0 certifi==2022.12.7 charset-normalizer==2.1.1 colorama==0.4.6 diffusers @ git+https://github.com/huggingface/diffusers.git@9b37ed33b5fa09e594b38e4e6f7477beff3bd66a et-xmlfile==1.1.0 filelock==3.9.0 flatbuffers==22.12.6 frozenlist==1.3.3 fsspec==2022.11.0 ftfy==6.1.1 gast==0.4.0 google-auth==2.15.0 google-auth-oauthlib==0.4.6 google-pasta==0.2.0 gpt-2-simple==0.8.1 grpcio==1.51.1 h5py==3.7.0 huggingface-hub==0.11.1 idna==3.4 imageio==2.24.0 importlib-metadata==6.0.0 Jinja2==3.1.2 joblib==1.2.0 keras==2.11.0 libclang==14.0.6 lightning-utilities==0.5.0 Markdown==3.4.1 MarkupSafe==2.1.1 modelcards==0.1.6 multidict==6.0.4 networkx==3.0 numpy==1.24.0 oauthlib==3.2.2 omegaconf==2.3.0 openai==0.25.0 opencv-python-headless==4.7.0.68 openpyxl==3.0.10 opt-einsum==3.3.0 packaging==22.0 pandas==1.5.2 pandas-stubs==1.5.2.221213 Pillow==9.4.0 protobuf==3.19.6 psutil==5.9.4 pyasn1==0.4.8 pyasn1-modules==0.2.8 python-dateutil==2.8.2 pytorch-lightning==1.8.6 pytz==2022.7 PyWavelets==1.4.1 pywin32==305 PyYAML==6.0 qudida==0.0.4 regex==2022.10.31 requests==2.28.1 requests-oauthlib==1.3.1 rsa==4.9 scikit-image==0.19.3 scikit-learn==1.2.0 scipy==1.10.0 six==1.16.0 tensorboard==2.11.0 tensorboard-data-server==0.6.1 tensorboard-plugin-wit==1.8.1 tensorboardX==2.5.1 tensorflow==2.11.0 tensorflow-estimator==2.11.0 tensorflow-intel==2.11.0 tensorflow-io-gcs-filesystem==0.29.0 termcolor==2.1.1 threadpoolctl==3.1.0 tifffile==2022.10.10 tokenizers==0.13.2 toposort==1.7 torch==1.13.1 torchmetrics==0.11.0 tqdm==4.64.1 -e git+https://github.com/huggingface/transformers.git@056218dab1e59939a14f085ce5edcdd166053073#egg=transformers types-pytz==2022.7.0.0 typing_extensions==4.4.0 urllib3==1.26.13 wcwidth==0.2.6 Werkzeug==2.2.2 wrapt==1.14.1 yarl==1.8.2 zipp==3.11.0

angrysky56 avatar Jan 16 '23 08:01 angrysky56

you could do this to get a cleaner list but is still isn't recommended. 'pip list --format=freeze > requirements.txt'

I found this too

On you bash shell you can simply run conda list | awk {'print $1'} |sed '/#/d;/_/d'> requirements.txt

In above code, I am just getting the dependencies name and removing lines starting with # and _ from the file.This will not include any version of the dependencies. *This could be run as bash script.

angrysky56 avatar Jan 22 '23 22:01 angrysky56

You're not meant to install dependencies this way, https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs#linux . It's done automatically, because there's a lot of border cases, systems, versions and models to support, and this repo tries to be friendly for unexperienced users. If you still want to do it manually, then i suggest checking

https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/50fb20cedc8dcbf64f86aed6d6e89595d655e638/launch.py#L175

Can someone look at this- this seems to be what automatic1111 needs but I am so ignorant I don't want to bother anyone sorry if this is useless- Similar to pip, pip-tools must be installed in each of your project's virtual environments:

$ source /path/to/venv/bin/activate (venv) $ python -m pip install pip-tools Note: all of the remaining example commands assume you've activated your project's virtual environment.

Example usage for pip-compile The pip-compile command lets you compile a requirements.txt file from your dependencies, specified in either pyproject.toml, setup.cfg, setup.py, or requirements.in.

Run it with pip-compile or python -m piptools compile. If you use multiple Python versions, you can also run py -X.Y -m piptools compile on Windows and pythonX.Y -m piptools compile on other systems.

pip-compile should be run from the same virtual environment as your project so conditional dependencies that require a specific Python version, or other environment markers, resolve relative to your project's environment.

Note: If pip-compile finds an existing requirements.txt file that fulfils the dependencies then no changes will be made, even if updates are available. To compile from scratch, first delete the existing requirements.txt file, or see Updating requirements for alternative approaches. https://github.com/jazzband/pip-tools

angrysky56 avatar Mar 29 '23 20:03 angrysky56