Open guterresrafael opened 3 months ago
Same issue on Windows 10
I have the same error with profile auto
under Debian. The build succeeded but container fails to start. Here is the full log:
/stable-diffusion-webui
total 772K
drwxr-xr-x 1 root root 4.0K Aug 12 20:48 .
drwxr-xr-x 1 root root 4.0K Aug 14 02:32 ..
-rw-r--r-- 1 root root 48 Aug 12 20:46 .eslintignore
-rw-r--r-- 1 root root 3.4K Aug 12 20:46 .eslintrc.js
drwxr-xr-x 8 root root 4.0K Aug 12 20:46 .git
-rw-r--r-- 1 root root 55 Aug 12 20:46 .git-blame-ignore-revs
drwxr-xr-x 4 root root 4.0K Aug 12 20:46 .github
-rw-r--r-- 1 root root 521 Aug 12 20:46 .gitignore
-rw-r--r-- 1 root root 119 Aug 12 20:46 .pylintrc
-rw-r--r-- 1 root root 84K Aug 12 20:46 CHANGELOG.md
-rw-r--r-- 1 root root 243 Aug 12 20:46 CITATION.cff
-rw-r--r-- 1 root root 657 Aug 12 20:46 CODEOWNERS
-rw-r--r-- 1 root root 35K Aug 12 20:46 LICENSE.txt
-rw-r--r-- 1 root root 13K Aug 12 20:46 README.md
-rw-r--r-- 1 root root 146 Aug 12 20:46 _typos.toml
drwxr-xr-x 2 root root 4.0K Aug 12 20:46 configs
drwxr-xr-x 2 root root 4.0K Aug 12 20:46 embeddings
-rw-r--r-- 1 root root 167 Aug 12 20:46 environment-wsl2.yaml
drwxr-xr-x 2 root root 4.0K Aug 12 20:46 extensions
drwxr-xr-x 13 root root 4.0K Aug 12 20:46 extensions-builtin
drwxr-xr-x 2 root root 4.0K Aug 12 20:46 html
drwxr-xr-x 2 root root 4.0K Aug 12 20:48 interrogate
drwxr-xr-x 2 root root 4.0K Aug 12 20:46 javascript
-rw-r--r-- 1 root root 1.3K Aug 12 20:46 launch.py
drwxr-xr-x 2 root root 4.0K Aug 12 20:46 localizations
drwxr-xr-x 7 root root 4.0K Aug 12 20:46 models
drwxr-xr-x 7 root root 4.0K Aug 12 20:46 modules
-rw-r--r-- 1 root root 185 Aug 12 20:46 package.json
-rw-r--r-- 1 root root 841 Aug 12 20:46 pyproject.toml
drwxr-xr-x 8 root root 4.0K Aug 12 20:41 repositories
-rw-r--r-- 1 root root 49 Aug 12 20:46 requirements-test.txt
-rw-r--r-- 1 root root 371 Aug 12 20:46 requirements.txt
-rw-r--r-- 1 root root 42 Aug 12 20:46 requirements_npu.txt
-rw-r--r-- 1 root root 645 Aug 12 20:46 requirements_versions.txt
-rw-r--r-- 1 root root 411K Aug 12 20:46 screenshot.png
-rw-r--r-- 1 root root 6.1K Aug 12 20:46 script.js
drwxr-xr-x 2 root root 4.0K Aug 12 20:46 scripts
-rw-r--r-- 1 root root 43K Aug 12 20:46 style.css
drwxr-xr-x 4 root root 4.0K Aug 12 20:46 test
drwxr-xr-x 2 root root 4.0K Aug 12 20:46 textual_inversion_templates
-rw-r--r-- 1 root root 670 Aug 12 20:46 webui-macos-env.sh
-rw-r--r-- 1 root root 84 Aug 12 20:46 webui-user.bat
-rw-r--r-- 1 root root 1.4K Aug 12 20:46 webui-user.sh
-rw-r--r-- 1 root root 2.3K Aug 12 20:46 webui.bat
-rw-r--r-- 1 root root 5.3K Aug 12 20:46 webui.py
-rwxr-xr-x 1 root root 11K Aug 12 20:46 webui.sh
Mounted .cache
Mounted config_states
mkdir: created directory '/stable-diffusion-webui/repositories/CodeFormer'
mkdir: created directory '/stable-diffusion-webui/repositories/CodeFormer/weights'
Mounted .cache
Mounted embeddings
Mounted config.json
Mounted models
Mounted styles.csv
Mounted ui-config.json
Mounted extensions
Installing extension dependencies (if any)
Traceback (most recent call last):
File "/stable-diffusion-webui/webui.py", line 13, in <module>
initialize.imports()
File "/stable-diffusion-webui/modules/initialize.py", line 23, in imports
import gradio # noqa: F401
File "/opt/conda/lib/python3.10/site-packages/gradio/__init__.py", line 3, in <module>
import gradio.components as components
File "/opt/conda/lib/python3.10/site-packages/gradio/components/__init__.py", line 3, in <module>
from gradio.components.bar_plot import BarPlot
File "/opt/conda/lib/python3.10/site-packages/gradio/components/bar_plot.py", line 7, in <module>
import altair as alt
File "/opt/conda/lib/python3.10/site-packages/altair/__init__.py", line 650, in <module>
from altair.vegalite import *
File "/opt/conda/lib/python3.10/site-packages/altair/vegalite/__init__.py", line 2, in <module>
from .v5 import *
File "/opt/conda/lib/python3.10/site-packages/altair/vegalite/v5/__init__.py", line 2, in <module>
from altair.expr.core import datum
File "/opt/conda/lib/python3.10/site-packages/altair/expr/__init__.py", line 7, in <module>
from altair.expr.core import ConstExpression, FunctionExpression
File "/opt/conda/lib/python3.10/site-packages/altair/expr/core.py", line 6, in <module>
from altair.utils import SchemaBase
File "/opt/conda/lib/python3.10/site-packages/altair/utils/__init__.py", line 15, in <module>
from .plugin_registry import PluginRegistry
File "/opt/conda/lib/python3.10/site-packages/altair/utils/plugin_registry.py", line 6, in <module>
from typing_extensions import TypeAliasType, TypeIs, TypeVar
ImportError: cannot import name 'TypeIs' from 'typing_extensions' (/opt/conda/lib/python3.10/site-packages/typing_extensions.py)
Here's my investigation of the issue:
The problem is caused by altair update to v5.4.0, where higher requirement of typing_extensions>=4.10.0
is introduced (previously it was `typing_extensions>=4.0.1)
I further investigate the current packages installed in the container, there are two duplicated versions of tying_extensions
, where typing_extensions.py
belongs to version 4.9.0
, and that's the version actually resolved. This is why altair
cannot find its new TypeIs
export.
drwxr-xr-x 2 root root 4096 Apr 24 16:17 typing_extensions-4.11.0.dist-info/
drwxr-xr-x 2 root root 4096 Apr 24 16:22 typing_extensions-4.9.0.dist-info/
-rw-r--r-- 2 root root 110125 Jan 18 2024 typing_extensions.py
I start looking for where the duplicated packages got installed, and found that a fresh container from pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
already has these duplicated packages. I doubt that typing_extensions==4.9.0
comes with conda
, but further investigation is needed. Hope someone can continue from here.
A workaround for this seems to be uninstalling all typing_extensions
and reinstall typing_extensions==4.11.0
in the docker file. Need someone to confirm if this is a good solution.
Here's my investigation of the issue:
- The problem is caused by altair update to v5.4.0, where higher requirement of
typing_extensions>=4.10.0
is introduced (previously it was `typing_extensions>=4.0.1)- I further investigate the current packages installed in the container, there are two duplicated versions of
tying_extensions
, wheretyping_extensions.py
belongs to version4.9.0
, and that's the version actually resolved. This is whyaltair
cannot find its newTypeIs
export.drwxr-xr-x 2 root root 4096 Apr 24 16:17 typing_extensions-4.11.0.dist-info/ drwxr-xr-x 2 root root 4096 Apr 24 16:22 typing_extensions-4.9.0.dist-info/ -rw-r--r-- 2 root root 110125 Jan 18 2024 typing_extensions.py
- I start looking for where the duplicated packages got installed, and found that a fresh container from
pytorch/pytorch:2.3.0-cuda12.1-cudnn8-runtime
already has these duplicated packages. I doubt thattyping_extensions==4.9.0
comes withconda
, but further investigation is needed. Hope someone can continue from here.- A workaround for this seems to be uninstalling all
typing_extensions
and reinstalltyping_extensions==4.11.0
in the docker file. Need someone to confirm if this is a good solution.
Can you share your revised Dockerfile? Or where you are putting typing_extensions==4.11.0
I inserted it in this line of the Dockerfile and it is working in my environment.
Inserted are the following
RUN --mount=type=cache,target=/root/.cache/pip \
pip uninstall -y typing_extensions && \
pip install typing_extensions==4.11.0
The suggestion by @yasu-nxt worked for me.
RUN mkdir ${ROOT}/interrogate && cp ${ROOT}/repositories/clip-interrogator/clip_interrogator/data/* ${ROOT}/interrogate
RUN --mount=type=cache,target=/root/.cache/pip \
pip uninstall -y typing_extensions && \
pip install typing_extensions==4.11.0
RUN --mount=type=cache,target=/root/.cache/pip \
pip install pyngrok xformers==0.0.26.post1 \
git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 \
git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \
git+https://github.com/mlfoundations/open_clip.git@v2.20.0```
I inserted it in this line of the Dockerfile and it is working in my environment.
Inserted are the following
RUN --mount=type=cache,target=/root/.cache/pip \ pip uninstall -y typing_extensions && \ pip install typing_extensions==4.11.0
This worked for me too.
Using Ubuntu.
RUN --mount=type=cache,target=/root/.cache/pip \ pip uninstall -y typing_extensions && \ pip install typing_extensions==4.11.0
this works for me too. Thanks!
Works for me too! Ubuntu 22.04
Confirmed fixed in debian 12.1
Confirmed fixed in ubuntu 22.04
I inserted it in this line of the Dockerfile and it is working in my environment. https://github.com/AbdBarho/stable-diffusion-webui-docker/blob/master/services/AUTOMATIC1111/Dockerfile#L41 Inserted are the following
RUN --mount=type=cache,target=/root/.cache/pip \ pip uninstall -y typing_extensions && \ pip install typing_extensions==4.11.0
This worked for me too.
Using Ubuntu.
Confirmed fixed in Windows Docker Desktop 4.31.1 (WSL2)
i fixed this by adding
# Add this line to update typing_extensions
RUN pip install --upgrade typing_extensions
Hi,
I have error on command "docker compose --profile auto up --build"
ImportError: cannot import name 'TypeIs' from 'typing_extensions' (/opt/conda/lib/python3.10/site-packages/typing_extensions.py)