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

cannot import name 'deprecated' from 'typing_extensions' #22

Open
picarica opened this issue Aug 14, 2023 · 5 comments
Open

cannot import name 'deprecated' from 'typing_extensions' #22

picarica opened this issue Aug 14, 2023 · 5 comments

Comments

@picarica
Copy link

hello i tried it with alisa
alias drun='docker run -e HSA_OVERRIDE_GFX_VERSION=10.3.0 -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $(pwd):/pwd'
and ran with
drun --name stable-diffusion l1naforever/stable-diffusion-rocm:latest
but i got this issue

Installing requirements for Web UI Launching Web UI with arguments: --precision full --no-half Traceback (most recent call last): File "launch.py", line 169, in <module> start_webui() File "launch.py", line 163, in start_webui import webui File "/sd/webui.py", line 8, in <module> from fastapi.middleware.gzip import GZipMiddleware File "/opt/conda/lib/python3.7/site-packages/fastapi/__init__.py", line 7, in <module> from .applications import FastAPI as FastAPI File "/opt/conda/lib/python3.7/site-packages/fastapi/applications.py", line 16, in <module> from fastapi import routing File "/opt/conda/lib/python3.7/site-packages/fastapi/routing.py", line 22, in <module> from fastapi import params File "/opt/conda/lib/python3.7/site-packages/fastapi/params.py", line 5, in <module> from pydantic.fields import FieldInfo File "/opt/conda/lib/python3.7/site-packages/pydantic/__init__.py", line 13, in <module> from . import dataclasses File "/opt/conda/lib/python3.7/site-packages/pydantic/dataclasses.py", line 11, in <module> from ._internal import _config, _decorators, _typing_extra File "/opt/conda/lib/python3.7/site-packages/pydantic/_internal/_config.py", line 9, in <module> from ..config import ConfigDict, ExtraValues, JsonEncoder, JsonSchemaExtraCallable File "/opt/conda/lib/python3.7/site-packages/pydantic/config.py", line 9, in <module> from .deprecated.config import BaseConfig File "/opt/conda/lib/python3.7/site-packages/pydantic/deprecated/config.py", line 6, in <module> from typing_extensions import Literal, deprecated ImportError: cannot import name 'deprecated' from 'typing_extensions' (/opt/conda/lib/python3.7/site-packages/typing_extensions.py)
couldn find much on google not sure why

i have RX 6500
and i am using rocm versions 5.4.2 on gentoo

@kaiser62
Copy link

Same issue, running on Ubuntu 22.04.3 LTS x86_64
GPU: AMD ATI Radeon RX 5700XT

@kyle170
Copy link

kyle170 commented Oct 16, 2023

Also getting this issue

@omgitsaheadcrab
Copy link

omgitsaheadcrab commented Jan 27, 2024

I got this too, using baked rather than latest works though

@dkman123
Copy link

I found this possible solution:
fastapi/fastapi#9808

In short, running "pip uninstall typing_extensions --yes" and then reinstalling "pip install typing_extensions==4.7.1"

But I can't interactive into the container because it auto-exits so docker thinks it's in a "restarting" state.

I tried baked instead of latest, but I get a different error.

File "/sd/modules/paths.py", line 34, in
assert sd_path is not None, f"Couldn't find Stable Diffusion in any of: {possible_sd_paths}"
AssertionError: Couldn't find Stable Diffusion in any of: ['/sd/repositories/stable-diffusion-stability-ai', '.', '/']

@dkman123
Copy link

dkman123 commented Feb 21, 2024

I was able to fumble my way through bypassing the typing_extensions error, but then I got the path error:

assert sd_path is not None, f"Couldn't find Stable Diffusion in any of: {possible_sd_paths}"
stable-diffusion | AssertionError: Couldn't find Stable Diffusion in any of: ['/sd/repositories/stable-diffusion-stability-ai', '.', '/']

NOTE: /sd/repositories/stable-diffusion-stability-ai does not exist. /sd/repositories/stable-diffusion does though.

I'm certainly not saying that this is the right way, but this is what I did:

# override the entry point so it won't crash right away
update my docker-compose.yml to add "entrypoint: /bin/sleep 1h"
# stop and recreate the container
sudo docker-compose -f docker-compose.yml stop stable-diffusion
sudo docker-compose -f docker-compose.yml up -d stable-diffusion
# enter the container
sudo docker exec -it stable-diffusion /bin/bash
# force the pip module version
pip uninstall typing_extensions --yes
pip install typing_extensions==4.7.1
# copy the folder outside the container (using outputs as temporary storage)
mkdir /sd/outputs/site-packages
cp -R /opt/conda/lib/python3.7/site-packages/* /sd/site-packages/.
exit
# then outside the container (set your {folder} to wherever your files live)
# move the folder outside of outputs
mv {folder}/outputs/site-packages/* {folder}/site-packages/.
# make sure you don't have a /site-packages/site-packages/ situation going on
# add to the docker-compose.yml volumes
- {folder}/site-packages:/opt/conda/lib/python3.7/site-packages

Just looking for where that folder name exists:

root@19dc15f6c996:/sd# grep -r --include \*.py --include \*.sh "stable-diffusion-stability-ai" *
modules/sd_models.py:    # stable-diffusion-stability-ai hard-codes the midas model path to
modules/paths.py:possible_sd_paths = [os.path.join(script_path, 'repositories/stable-diffusion-stability-ai'), '.', os.path.dirname(script_path)]
modules/launch_utils.py:    git_clone(stable_diffusion_repo, repo_dir('stable-diffusion-stability-ai'), "Stable Diffusion", stable_diffusion_commit_hash)

But I don't know what to do with that information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants