AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
139.66k stars 26.47k forks source link

[Bug]: Fresh install crash "ModuleNotFoundError: No module named 'dockerpycreds' #14249

Open skimail opened 9 months ago

skimail commented 9 months ago

Is there an existing issue for this?

What happened?

Fresh install of stable python and stable diffusion, crashes on load with error "ModuleNotFoundError: No module named 'dockerpycreds'

Steps to reproduce the problem

  1. Install automatic1111 using "git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git"
  2. Run webui-user.bat
  3. Fails to load

What should have happened?

It should have loaded

Sysinfo

Unable to load WebUI

What browsers do you use to access the UI ?

Google Chrome

Console logs

venv "C:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.6.1
Commit hash: 4afaaf8a020c1df457bcf7250cb1c7f609699fa7
Installing requirements
Launching Web UI with arguments:
Traceback (most recent call last):
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\transformers\utils\import_utils.py", line 1126, in _get_module
    return importlib.import_module("." + module_name, self.__name__)
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.3056.0_x64__qbz5n2kfra8p0\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\transformers\modeling_utils.py", line 83, in <module>
    from accelerate import __version__ as accelerate_version
  File "C:\stable-diffusion-webui\venv\lib\site-packages\accelerate\__init__.py", line 3, in <module>
    from .accelerator import Accelerator
  File "C:\stable-diffusion-webui\venv\lib\site-packages\accelerate\accelerator.py", line 41, in <module>
    from .tracking import LOGGER_TYPE_TO_CLASS, GeneralTracker, filter_trackers
  File "C:\stable-diffusion-webui\venv\lib\site-packages\accelerate\tracking.py", line 50, in <module>
    import wandb
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\wandb\__init__.py", line 26, in <module>
    from wandb import sdk as wandb_sdk
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\wandb\sdk\__init__.py", line 5, in <module>
    from .wandb_artifacts import Artifact  # noqa: F401
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\wandb\sdk\wandb_artifacts.py", line 33, in <module>
    from wandb.apis import InternalApi, PublicApi
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\wandb\apis\__init__.py", line 43, in <module>
    from .public import Api as PublicApi  # noqa
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\wandb\apis\public.py", line 53, in <module>
    from wandb.sdk.launch.utils import (
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\wandb\sdk\launch\utils.py", line 13, in <module>
    import wandb.docker as docker
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\wandb\docker\__init__.py", line 8, in <module>
    from dockerpycreds.utils import find_executable  # type: ignore
ModuleNotFoundError: No module named 'dockerpycreds'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\stable-diffusion-webui\launch.py", line 48, in <module>
    main()
  File "C:\stable-diffusion-webui\launch.py", line 44, in main
    start()
  File "C:\stable-diffusion-webui\modules\launch_utils.py", line 432, in start
    import webui
  File "C:\stable-diffusion-webui\webui.py", line 13, in <module>
    initialize.imports()
  File "C:\stable-diffusion-webui\modules\initialize.py", line 16, in imports
    import pytorch_lightning  # noqa: F401
  File "C:\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\__init__.py", line 35, in <module>
    from pytorch_lightning.callbacks import Callback  # noqa: E402
  File "C:\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks\__init__.py", line 14, in <module>
    from pytorch_lightning.callbacks.batch_size_finder import BatchSizeFinder
  File "C:\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks\batch_size_finder.py", line 24, in <module>
    from pytorch_lightning.callbacks.callback import Callback
  File "C:\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\callbacks\callback.py", line 25, in <module>
    from pytorch_lightning.utilities.types import STEP_OUTPUT
  File "C:\stable-diffusion-webui\venv\lib\site-packages\pytorch_lightning\utilities\types.py", line 27, in <module>
    from torchmetrics import Metric
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\torchmetrics\__init__.py", line 14, in <module>
    from torchmetrics import functional  # noqa: E402
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\torchmetrics\functional\__init__.py", line 82, in <module>
    from torchmetrics.functional.text.bleu import bleu_score
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\torchmetrics\functional\text\__init__.py", line 30, in <module>
    from torchmetrics.functional.text.bert import bert_score  # noqa: F401
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\torchmetrics\functional\text\bert.py", line 24, in <module>
    from torchmetrics.functional.text.helper_embedding_metric import (
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\torchmetrics\functional\text\helper_embedding_metric.py", line 26, in <module>
    from transformers import AutoModelForMaskedLM, AutoTokenizer, PreTrainedModel, PreTrainedTokenizerBase
  File "<frozen importlib._bootstrap>", line 1075, in _handle_fromlist
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\transformers\utils\import_utils.py", line 1116, in __getattr__
    module = self._get_module(self._class_to_module[name])
  File "C:\Users\donov\AppData\Roaming\Python\Python310\site-packages\transformers\utils\import_utils.py", line 1128, in _get_module
    raise RuntimeError(
RuntimeError: Failed to import transformers.modeling_utils because of the following error (look up to see its traceback):
No module named 'dockerpycreds'
Press any key to continue . . .

Additional information

Reinstalled from scratch, removed python and git, reinstalled both, did a fresh git pull get this error. If i try to pip install dockerpycreds I get the following message: "ERROR: Could not find a version that satisfies the requirement dockerpycreds (from versions: none) ERROR: No matching distribution found for dockerpycreds"

w-e-w commented 9 months ago

I don't really see how that can happen

as far as I can tell the version of transformers we are using don't depends on dockerpycreds how's I can't find the line of code that is shown in your error log

try running pip freeze in webui's venv and post the output

pip freeze
skimail commented 9 months ago

I don't really see how that can happen

as far as I can tell the version of transformers we are using don't depends on dockerpycreds how's I can't find the line of code that is shown in your error log

try running pip freeze in webui's venv and post the output

pip freeze

I get nothing, it's completely blank. I believe everything is installed in the venv? When I go to the stable-diffusion-webui/venv/Scripts folder it contains the following:

12/08/2023  07:11 AM           108,412 accelerate-config.exe
12/08/2023  07:11 AM           108,412 accelerate-launch.exe
12/08/2023  07:11 AM           108,420 accelerate.exe
12/08/2023  07:08 AM             2,070 activate
12/08/2023  07:08 AM               999 activate.bat
12/08/2023  07:08 AM            26,199 Activate.ps1
12/08/2023  07:09 AM           108,439 convert-caffe2-to-onnx.exe
12/08/2023  07:09 AM           108,439 convert-onnx-to-caffe2.exe
12/08/2023  07:08 AM               393 deactivate.bat
12/08/2023  07:10 AM           108,403 f2py.exe
12/08/2023  07:10 AM           108,404 fonttools.exe
12/08/2023  07:10 AM           108,394 ftfy.exe
12/08/2023  07:10 AM           108,402 futurize.exe
12/08/2023  07:10 AM           108,395 gdown.exe
12/08/2023  07:10 AM           108,420 google-oauthlib-tool.exe
12/08/2023  07:11 AM           108,394 gradio.exe
12/08/2023  07:11 AM           108,391 httpx.exe
12/08/2023  07:10 AM           108,426 huggingface-cli.exe
12/08/2023  07:10 AM           108,428 imageio_download_bin.exe
12/08/2023  07:10 AM           108,424 imageio_remove_bin.exe
12/08/2023  07:09 AM           108,392 isympy.exe
12/08/2023  07:11 AM           108,400 jsonschema.exe
12/08/2023  07:10 AM           108,402 lsm2bin.exe
12/08/2023  07:10 AM           108,401 markdown_py.exe
12/08/2023  07:09 AM           108,420 normalizer.exe
12/08/2023  07:11 AM               229 numba
12/08/2023  07:10 AM           108,404 pasteurize.exe
12/08/2023  07:08 AM           108,408 pip.exe
12/08/2023  07:08 AM           108,408 pip3.10.exe
12/08/2023  07:08 AM           108,408 pip3.exe
12/08/2023  07:10 AM           108,401 pyftmerge.exe
12/08/2023  07:10 AM           108,402 pyftsubset.exe
12/08/2023  07:10 AM             6,318 pygrun
12/08/2023  07:10 AM           108,399 pyrsa-decrypt.exe
12/08/2023  07:10 AM           108,399 pyrsa-encrypt.exe
12/08/2023  07:10 AM           108,397 pyrsa-keygen.exe
12/08/2023  07:10 AM           108,420 pyrsa-priv2pub.exe
12/08/2023  07:10 AM           108,393 pyrsa-sign.exe
12/08/2023  07:10 AM           108,397 pyrsa-verify.exe
12/08/2023  07:08 AM           268,568 python.exe
12/08/2023  07:08 AM           257,304 pythonw.exe
12/08/2023  07:10 AM           108,410 tensorboard.exe
12/08/2023  07:10 AM           108,406 tiff2fsspec.exe
12/08/2023  07:10 AM           108,406 tiffcomment.exe
12/08/2023  07:10 AM           108,394 tifffile.exe
12/08/2023  07:09 AM           108,407 torchrun.exe
12/08/2023  07:11 AM           108,424 transformers-cli.exe
12/08/2023  07:10 AM           108,399 ttx.exe
12/08/2023  07:11 AM           108,412 upload_theme.exe
12/08/2023  07:10 AM           108,422 yapf-diff.exe
12/08/2023  07:10 AM           108,398 yapf.exe
w-e-w commented 9 months ago

https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/13840 read method 1 on how to active a venv don't install httpx just run pip freeze

skimail commented 9 months ago

Solved!

I used cmd in my stable-diffusion folder, then ran the command venv\Scripts\activate pip freeze

I then uninstalled every single item listed. Any that it couldn't remove it gave me the location of and I was able to manually delete them. I then did a fresh clean install of stable diffusion with git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git

Now it's work. I think it must have been some oddball thing not associated with stable-diffusion that I had previously installed, sorry about that!

Here's my pip freeze result after the fix:

absl-py==2.0.0
accelerate==0.21.0
addict==2.4.0
aenum==3.1.15
aiofiles==23.2.1
aiohttp==3.9.1
aiosignal==1.3.1
altair==5.2.0
antlr4-python3-runtime==4.9.3
anyio==3.7.1
async-timeout==4.0.3
attrs==23.1.0
basicsr==1.4.2
beautifulsoup4==4.12.2
blendmodes==2022
boltons==23.1.1
cachetools==5.3.2
certifi==2023.11.17
charset-normalizer==3.3.2
clean-fid==0.1.35
click==8.1.7
clip==1.0
colorama==0.4.6
contourpy==1.2.0
cycler==0.12.1
deprecation==2.1.0
einops==0.4.1
exceptiongroup==1.2.0
facexlib==0.3.0
fastapi==0.94.0
ffmpy==0.3.1
filelock==3.13.1
filterpy==1.4.5
fonttools==4.46.0
frozenlist==1.4.0
fsspec==2023.12.1
ftfy==6.1.3
future==0.18.3
gdown==4.7.1
gfpgan==1.3.8
gitdb==4.0.11
GitPython==3.1.32
google-auth==2.25.2
google-auth-oauthlib==1.1.0
gradio==3.41.2
gradio_client==0.5.0
grpcio==1.60.0
h11==0.12.0
httpcore==0.15.0
httpx==0.24.1
huggingface-hub==0.19.4
idna==3.6
imageio==2.33.0
importlib-metadata==7.0.0
importlib-resources==6.1.1
inflection==0.5.1
Jinja2==3.1.2
jsonmerge==1.8.0
jsonschema==4.20.0
jsonschema-specifications==2023.11.2
kiwisolver==1.4.5
kornia==0.6.7
lark==1.1.2
lazy_loader==0.3
lightning-utilities==0.10.0
llvmlite==0.41.1
lmdb==1.4.1
lpips==0.1.4
Markdown==3.5.1
MarkupSafe==2.1.3
matplotlib==3.8.2
mpmath==1.3.0
multidict==6.0.4
networkx==3.2.1
numba==0.58.1
numpy==1.23.5
oauthlib==3.2.2
omegaconf==2.2.3
open-clip-torch==2.20.0
opencv-python==4.8.1.78
orjson==3.9.10
packaging==23.2
pandas==2.1.4
piexif==1.1.3
Pillow==9.5.0
platformdirs==4.1.0
protobuf==3.20.0
psutil==5.9.5
pyasn1==0.5.1
pyasn1-modules==0.3.0
pydantic==1.10.13
pydub==0.25.1
pyparsing==3.1.1
PySocks==1.7.1
python-dateutil==2.8.2
python-multipart==0.0.6
pytorch-lightning==1.9.4
pytz==2023.3.post1
PyWavelets==1.5.0
PyYAML==6.0.1
realesrgan==0.3.0
referencing==0.32.0
regex==2023.10.3
requests==2.31.0
requests-oauthlib==1.3.1
resize-right==0.0.2
rpds-py==0.13.2
rsa==4.9
safetensors==0.3.1
scikit-image==0.21.0
scipy==1.11.4
semantic-version==2.10.0
sentencepiece==0.1.99
six==1.16.0
smmap==5.0.1
sniffio==1.3.0
soupsieve==2.5
starlette==0.26.1
sympy==1.12
tb-nightly==2.16.0a20231208
tensorboard-data-server==0.7.2
tf-keras-nightly==2.16.0.dev2023120810
tifffile==2023.9.26
timm==0.9.2
tokenizers==0.13.3
tomesd==0.1.3
tomli==2.0.1
toolz==0.12.0
torch==2.0.1+cu118
torchdiffeq==0.2.3
torchmetrics==1.2.1
torchsde==0.2.5
torchvision==0.15.2+cu118
tqdm==4.66.1
trampoline==0.1.2
transformers==4.30.2
typing_extensions==4.8.0
tzdata==2023.3
urllib3==2.1.0
uvicorn==0.24.0.post1
wcwidth==0.2.12
websockets==11.0.3
Werkzeug==3.0.1
yapf==0.40.2
yarl==1.9.4
zipp==3.17.0

;-------------------- Leave previous entry for posterity.

13840 read method 1 on how to active a venv don't install httpx just run pip freeze

C:\stable-diffusion-webui>venv\Scripts\activate

Thank you! Here it is:

(venv) C:\stable-diffusion-webui>pip freeze
absl-py==2.0.0
accelerate==0.21.0
addict==2.4.0
aenum==3.1.15
aiofiles==23.2.1
aiohttp==3.9.1
aiosignal==1.3.1
altair==5.2.0
antlr4-python3-runtime==4.9.3
anyio==3.7.1
async-timeout==4.0.3
attrs==23.1.0
basicsr==1.4.2
beautifulsoup4==4.12.2
blendmodes==2022
boltons==23.1.1
cachetools==5.3.2
certifi==2023.11.17
charset-normalizer==3.3.2
clean-fid==0.1.35
click==8.1.7
clip @ https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip
colorama==0.4.6
contourpy==1.2.0
cycler==0.12.1
deprecation==2.1.0
einops==0.4.1
exceptiongroup==1.2.0
facexlib==0.3.0
fastapi==0.94.0
ffmpy==0.3.1
filelock==3.13.1
filterpy==1.4.5
fonttools==4.46.0
frozenlist==1.4.0
fsspec==2023.12.1
ftfy==6.1.3
future==0.18.3
gdown==4.7.1
gfpgan==1.3.8
gitdb==4.0.11
GitPython==3.1.32
google-auth==2.25.1
google-auth-oauthlib==1.1.0
gradio==3.41.2
gradio_client==0.5.0
grpcio==1.60.0
h11==0.12.0
httpcore==0.15.0
httpx==0.24.1
huggingface-hub==0.19.4
idna==3.6
imageio==2.33.0
importlib-metadata==7.0.0
importlib-resources==6.1.1
inflection==0.5.1
Jinja2==3.1.2
jsonmerge==1.8.0
jsonschema==4.20.0
jsonschema-specifications==2023.11.2
kiwisolver==1.4.5
kornia==0.6.7
lark==1.1.2
lazy_loader==0.3
lightning-utilities==0.10.0
llvmlite==0.41.1
lmdb==1.4.1
lpips==0.1.4
Markdown==3.5.1
MarkupSafe==2.1.3
matplotlib==3.8.2
mpmath==1.3.0
multidict==6.0.4
networkx==3.2.1
numba==0.58.1
numpy==1.23.5
oauthlib==3.2.2
omegaconf==2.2.3
open-clip-torch==2.20.0
opencv-python==4.8.1.78
orjson==3.9.10
packaging==23.2
pandas==2.1.3
piexif==1.1.3
Pillow==9.5.0
platformdirs==4.1.0
protobuf==3.20.0
psutil==5.9.5
pyasn1==0.5.1
pyasn1-modules==0.3.0
pydantic==1.10.13
pydub==0.25.1
pyparsing==3.1.1
PySocks==1.7.1
python-dateutil==2.8.2
python-multipart==0.0.6
pytorch-lightning==1.9.4
pytz==2023.3.post1
PyWavelets==1.5.0
PyYAML==6.0.1
realesrgan==0.3.0
referencing==0.32.0
regex==2023.10.3
requests==2.31.0
requests-oauthlib==1.3.1
resize-right==0.0.2
rpds-py==0.13.2
rsa==4.9
safetensors==0.3.1
scikit-image==0.21.0
scipy==1.11.4
semantic-version==2.10.0
sentencepiece==0.1.99
six==1.16.0
smmap==5.0.1
sniffio==1.3.0
soupsieve==2.5
starlette==0.26.1
sympy==1.12
tb-nightly==2.16.0a20231208
tensorboard-data-server==0.7.2
tf-keras-nightly==2.16.0.dev2023120810
tifffile==2023.9.26
timm==0.9.2
tokenizers==0.13.3
tomesd==0.1.3
tomli==2.0.1
toolz==0.12.0
torch==2.0.1+cu118
torchdiffeq==0.2.3
torchmetrics==0.11.4
torchsde==0.2.5
torchvision==0.15.2+cu118
tqdm==4.65.0
trampoline==0.1.2
transformers==4.27.4
typing-inspect==0.8.0
typing_extensions==4.8.0
tzdata==2023.3
uc-micro-py==1.0.2
urllib3==2.1.0
uvicorn==0.22.0
voluptuous==0.13.1
wandb==0.15.0
wcwidth==0.2.6
websockets==11.0.2
Werkzeug==1.0.1
whichcraft==0.6.1
win32-setctime==1.1.0
wrapt==1.15.0
xformers==0.0.22.post7
yacs==0.1.8
yapf==0.40.2
yarl==1.9.2
youtube-dl==2021.12.17
yt-dlp==2023.10.13
zipp==3.15.0

I see youtube-dl==2021.12.17, I think that's something I had installed ages ago... is there any way to clear all of these and restart?

clamsdown commented 8 months ago

How did you uninstall each item? Did you literally do every single one?