stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: webui fails when following manual installation on linux with unknown jinja2 method
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
running python webui.py on a fresh installation following the manual guide throws
diffusers) ➜ stable-diffusion-webui git:(master) python webui.py
Warning: CodeFormer not found at path /home/myuser/Development/SD/stable-diffusion-webui/repositories/CodeFormer/inference_codeformer.py
Warning: k_diffusion not found at path /home/myuser/Development/SD/stable-diffusion-webui/repositories/k-diffusion/k_diffusion/sampling.py
Traceback (most recent call last):
File "/home/myuser/Development/SD/stable-diffusion-webui/webui.py", line 13, in <module>
from modules import devices, sd_samplers, upscaler, extensions, localization
File "/home/myuser/Development/SD/stable-diffusion-webui/modules/sd_samplers.py", line 11, in <module>
from modules import prompt_parser, devices, processing, images
File "/home/myuser/Development/SD/stable-diffusion-webui/modules/processing.py", line 14, in <module>
import modules.sd_hijack
File "/home/myuser/Development/SD/stable-diffusion-webui/modules/sd_hijack.py", line 10, in <module>
import modules.textual_inversion.textual_inversion
File "/home/myuser/Development/SD/stable-diffusion-webui/modules/textual_inversion/textual_inversion.py", line 13, in <module>
from modules import shared, devices, sd_hijack, processing, sd_models, images
File "/home/myuser/Development/SD/stable-diffusion-webui/modules/shared.py", line 9, in <module>
import gradio as gr
File "/home/myuser/.conda/envs/diffusers/lib/python3.9/site-packages/gradio/__init__.py", line 3, in <module>
import gradio.components as components
File "/home/myuser/.conda/envs/diffusers/lib/python3.9/site-packages/gradio/components.py", line 32, in <module>
from gradio.blocks import Block
File "/home/myuser/.conda/envs/diffusers/lib/python3.9/site-packages/gradio/blocks.py", line 32, in <module>
from gradio import (
File "/home/myuser/.conda/envs/diffusers/lib/python3.9/site-packages/gradio/networking.py", line 18, in <module>
from gradio.routes import App
File "/home/myuser/.conda/envs/diffusers/lib/python3.9/site-packages/gradio/routes.py", line 56, in <module>
templates = Jinja2Templates(directory=STATIC_TEMPLATE_LIB)
File "/home/myuser/.conda/envs/diffusers/lib/python3.9/site-packages/starlette/templating.py", line 53, in __init__
self.env = self.get_env(directory)
File "/home/myuser/.conda/envs/diffusers/lib/python3.9/site-packages/starlette/templating.py", line 56, in get_env
@jinja2.contextfunction
AttributeError: module 'jinja2' has no attribute 'contextfunction')
Steps to reproduce the problem
Execute manual installation steps
run python webui.py
What should have happened?
WebUI should start with no issues on a fresh installation
Commit where the problem happens
ac085628540d0ec6a988fad93f5b8f2154209571
What platforms do you use to access UI ?
Linux
What browsers do you use to access the UI ?
Mozilla Firefox
Command Line Arguments
No response
Additional information, context and logs
>>> import pkg_resources
>>> version = pkg_resources.get_distribution("jinja2").version
>>> version
'3.1.2'
downgrading to pip install "jinja2 <=3.0.3" helps but should be added to requirements.txt if others run into this issue
Ran into this issue when doing a docker build from pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime. This should be included within the requirements.txt.
Closing as stale.