stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: AttributeError: module 'h11' has no attribute 'Event'
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
No run colub
Steps to reproduce the problem
- Go to ....
- Press ....
- ...
What should have happened?
File "launch.py", line 256, in
Commit where the problem happens
StableDiffusionUI
What platforms do you use to access UI ?
Windows
What browsers do you use to access the UI ?
Google Chrome
Command Line Arguments
No response
Additional information, context and logs
No response
link the colab
Need more info, but in any case you need to be running Python 3.10.x. The recommended build is 3.10.6. Several dependencies won't work with other major release versions of Python.
lmao this is why we have 1.2k issues
Yes. I am facing the same issue. It used to work perfectly before but this issue crawled up suddenly.
pip install --force-reinstall httpcore==0.15 works as a temporary workaround until some other fix is found. That or just append it to your requirement.txt This comes from a recent update in httpcore and nothing related to this repository.
pip install --force-reinstall httpcore==0.15 works as a temporary workaround until some other fix is found. That or just append it to your requirement.txt This comes from a recent update in httpcore and nothing related to this repository.
lmao this is why we have 1.2k issues
for real the dude didn't even title the issue
thanks, that just fix this problem for me
pip install --force-reinstall httpcore==0.15 it's just on a computer, but how to register in a colab? https://colab.research.google.com/drive/1wriLAuWlY1xlfq_Zpq0Fk5WgFTRFyyOG?usp=sharing
@TkonstAL add a new code cell in colab and then run
!pip install --force-reinstall httpcore==0.15
I also want to know how I can add this to the colab. https://huggingface.co/Gustavosta/MagicPrompt-Stable-Diffusion/tree/main Is it possible? I add - it used to work and now it doesn't?
just manually install for now whenever you need to use it, hopefully this will be fixed soon and you don't have to do anything.
also @TkonstAL can you please update the title of this bug report from [Bug]: #4833 to the below title please.
AttributeError: module 'h11' has no attribute 'Event'
I don't really know how to edit here. Where should I unpack it? https://www.reddit.com/r/StableDiffusion/comments/xvjm84/magicprompt_script_for_automatic1111_gui_let_the/ I read it but didn't fully understand. P.S i find this !pip install git+https://github.com/KichangKim/DeepDanbooru.git@edf73df4cdaeea2cf00e9ac08bd8a9026b7a7b26 but is non magicpromt
in your colab notebook https://www.reddit.com/r/StableDiffusion/comments/xvjm84/magicprompt_script_for_automatic1111_gui_let_the/
when you get the AttributeError: module 'h11' has no attribute 'Event'
, scroll up and add a new cell by clicking the + code
button
the copy paste the below command and run the cell
!pip install --force-reinstall httpcore==0.15
pip install --force-reinstall httpcore==0.15 works as a temporary workaround until some other fix is found. That or just append it to your requirement.txt This comes from a recent update in httpcore and nothing related to this repository.
lmao this is why we have 1.2k issues
for real the dude didn't even title the issue
Does not work for me still. I had to update python 3.8 to 3.10 to fix this issue. But its a hassle to update python. I thought that updating httpcore should work but it didn't
Guys both reinstalling httpcore and python doesn't work for me and I still get the same error
I tried to force reinstall httpcore, it worked last week, but no more now. try to replace the http11.py in "../'env'(or usr/local/) /lib/python3.8/site-packages/httpcore/_async/" or _sync corresponding to the ERROR by the files from below: (better to backup the original file first) httpcore.zip
Guys both reinstalling httpcore and python doesn't work for me and I still get the same error
Have you run it with the environment activated?
if not, run
source venv/bin/activate
before reinstalling.
Just wanted to note I saw this today. The above recommendations worked:
cd stable-diffusion-webui
source venv/bin/activate
pip install --force-reinstall httpcore==0.15
I am using Python 3.8 which seems to be the root of the problem. But if I update to Python 3.10, I get a whole problem that Torch cannot use my graphics card.
Is there any way to resolve this without upgrading to 3.10?
I tried: pip install --force-reinstall httpcore==0.15
And I also tried using the files linked above by @pluieciel ... still getting the exact same error, h11 has no attribute Event
cd stable-diffusion-webui source venv/Scripts/activate pip install --force-reinstall httpcore==0.15
also as am testing it on a pretty low spec laptop on file webui-user added: set COMMANDLINE_ARGS=--lowvram --precision full --no-half --skip-torch-cuda-test
Just adding that I had to run the python.exe that was in the venv directory directly to get 2.0 to run on Windows 10 stable-diffusion-webui\venv\scripts\python.exe -m pip install --force-reinstall httpcore==0.15
EDIT:
Just adding that I had to run the python.exe that was in the venv directory directly to get 2.0 to run on Windows 10 stable-diffusion-webui\venv\scripts\python.exe -m pip install --force-reinstall httpcore==0.15
This worked!!!! THANK YOU!
Need more info, but in any case you need to be running Python 3.10.x. The recommended build is 3.10.6. Several dependencies won't work with other major release versions of Python.
I just ran into this same issue because the pre-existing Python install on my PC was 3.9. I installed 3.10.8, it's working now.
Maybe the startup scripts could check that the python version is correct before running venv? Since Expected Python 3.10.x, got 3.9
would be a lot more informative than AttributeError: module 'h11' has no attribute 'Event'
.
I uninstalled python on chocolatey to install the correct version and now when i reinstall it doesnt work. Can anyone help?
Preface: I'm running on Windows 10
I was having the same issues. I finally got it to launch. I had installed Python 3.10, but apparently it installed for only my user. So when I launched, it used the system's Python 3.9.1 version. I uninstalled 3.10, then reinstalled for all users. But I was still getting the error. So, after seeing others in this thread talk about the Python.exe in the venv directory, I decided to nuke the whole venv
directory. After that, I relaunched and, after having to sit through all the other installing again, I finally got past the Web UI portion. Then after about 10 minutes of it downloading other requirements, I got to the loading weights and the message saying it was ready.
It appears that, even after installing Python 3.10 globally, for some reason it was still using a copy (?) of Python 3.9 in the venv directory.
Preface: I'm running on Windows 10
I was having the same issues. I finally got it to launch. I had installed Python 3.10, but apparently it installed for only my user. So when I launched, it used the system's Python 3.9.1 version. I uninstalled 3.10, then reinstalled for all users. But I was still getting the error. So, after seeing others in this thread talk about the Python.exe in the venv directory, I decided to nuke the whole
venv
directory. After that, I relaunched and, after having to sit through all the other installing again, I finally got past the Web UI portion. Then after about 10 minutes of it downloading other requirements, I got to the loading weights and the message saying it was ready.It appears that, even after installing Python 3.10 globally, for some reason it was still using a copy (?) of Python 3.9 in the venv directory.
This works! But what you really want to do is change the value in \venv\pyvenv.cfg to 310. That does the same thing, because nuking the whole folder for some reason used the old python version. This is how I fixed it.
Just wanted to note I saw this today. The above recommendations worked:
cd stable-diffusion-webui
source venv/bin/activate
pip install --force-reinstall httpcore==0.15
For windows(using cmd.exe):
cd stable-diffusion-webui venv\Scripts\activate.bat pip install --force-reinstall httpcore==0.15
After trying with ubuntu 18 and 20, switched to ubuntu22.0.4 (WSL2) which come by default now with python3.10.6
Also had to install some missing stuff, here is the full list. sudo apt install python3-venv sudo apt install libgl1-mesa-dev sudo apt install build-essential source venv/bin/activate pip install xformers==0.0.12 pip install triton
./webui.sh --xformers
EDIT: The previous setup does not work for xformers... the fact is that xformers in WSL simply does not worth the investment. I surrender and resetup myself in plain windows....
If you are in WINDOWS environment make sure you are running your command prompt in elevated privilege "Run as administrator".
Hi,
The same issue, i try to instal httpcore==0.15 but problem still exist.
... File "/usr/lib/python3.10/site-packages/httpcore/_sync/init.py", line 1, in module from .connection import HTTPConnection File "/usr/lib/python3.10/site-packages/httpcore/_sync/connection.py", line 13, in module from .http11 import HTTP11Connection File "/usr/lib/python3.10/site-packages/httpcore/_sync/http11.py", line 44, in module class HTTP11Connection(ConnectionInterface): File "/usr/lib/python3.10/site-packages/httpcore/_sync/http11.py", line 140, in HTTP11Connection self, event: h11.Event, timeout: Optional[float] = None AttributeError: module 'h11' has no attribute 'Event'
>pip list | grep "http" aiohttp 3.8.1 aiohttp-cors 0.7.0 httpcore 0.15.0 httpx 0.23.1
I uninstalled all h11 and httpcore packages. Reinstalled just h11's latest version and it worked. All the other steps mentioned above didn't work for me.