Closed dongyun-kim-arch closed 1 year ago
have the same question ๐ญ
Resolved this issue by updating SD v1.6 It seems the issue is related to the version... To use sd v1.6, python 3.10 is required.
Thank you for your quick reply! Do you mean to update python to 3.10? I saw that you cloned the 1.6 repository before
I fixed it with
pip install -U pip
pip install -U httpcore
Thanks for everyone so much, but all the modifications are not useful to me. ๐ญ I have tried SD version from 1.0.0 to 1.6.0, but still not work. When using SD version greater than 1.3.1, report an error: "TypeError: init() got an unexpected keyword argument 'socket_options'" . When using SD version less than 1.3.1, an error "ImportError: cannot import name 'Undefined' from" will be reported. 'pydantic.fields' (/home/user/stable-diffusion-webui/venv/lib/python3.8/site-packages/pydantic/fields.py)". I am running sdwebui in docker+python3.8. It seems that I need to change the operating environment.
Solution:
Create conda environment: $ conda create -y -n stable-diffusion python=3.10
Edit the following line of webui-user.sh: python_cmd="/home/USER_NAME/anaconda3/envs/stable-diffusion/bin/python3"
Run: bash webui.sh
Solution that ended up working form me: Delete VENV folder regenerate with
python3.10 -m venv venv
cd stable-diffusion-webui && source venv/bin/activate
pip3 install httpx==0.24.1
The wiki for webui helps for showing installation on linux, apt install python3.10-venv and make a venv with python3.10 if your system version is different. https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-NVidia-GPUs#linux
cd stable-diffusion-webui && source venv/bin/activate pip3 install httpx==0.24.1
It works for me! Thanks.
I got this error when I tried doing the following:
chmod +x webui.sh
bash webui.sh -f
(I used this subsequently to try to run Stable Diffusion Web UI)Then, I systematically tried all of the fixes suggested in this thread, but none of them worked:
I tried installing Python 3.10 by following this guide (Option 1), then adding an alias to my .bashrc
file (alias python="/usr/bin/python3.10"
) so that the Python which gets executed when I execute python
is actually Python 3.10. That didn't help with the error.
Then I activated the virtual environment by running source venv/bin/activate and I ran the following two commands:
pip install -U pip
pip install -U httpcore
After these commands, I got the following error. Here's the traceback:
(venv) root@C.7097089:~/stable-diffusion-webui$ bash webui.sh -f
################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################
################################################################
Running on root user
################################################################
################################################################
Repo already cloned, using it as install directory
################################################################
################################################################
python venv already activate or run without venv: /root/stable-diffusion-webui/venv
################################################################
################################################################
Launching launch.py...
################################################################
Cannot locate TCMalloc (improves CPU memory usage)
Python 3.8.10 (default, May 26 2023, 14:05:08)
[GCC 9.4.0]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Installing requirements
Launching Web UI with arguments: -f
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
Traceback (most recent call last):
File "launch.py", line 48, in <module>
main()
File "launch.py", line 44, in main
start()
File "/root/stable-diffusion-webui/modules/launch_utils.py", line 432, in start
import webui
File "/root/stable-diffusion-webui/webui.py", line 13, in <module>
initialize.imports()
File "/root/stable-diffusion-webui/modules/initialize.py", line 33, in imports
from modules import shared_init
File "/root/stable-diffusion-webui/modules/shared_init.py", line 5, in <module>
from modules import shared
File "/root/stable-diffusion-webui/modules/shared.py", line 5, in <module>
from modules import shared_cmd_options, shared_gradio_themes, options, shared_items, sd_models_types
File "/root/stable-diffusion-webui/modules/options.py", line 74, in <module>
class Options:
File "/root/stable-diffusion-webui/modules/options.py", line 77, in Options
def __init__(self, data_labels: dict[str, OptionInfo], restricted_opts):
TypeError: 'type' object is not subscriptable
I then tried pip3 install httpx==0.24.1 (still while inside the venv). It didn't fix the error above.
Since I got this error as a consequence of solving the original error in this thread, I am posting this here. I re-created this issue on multiple machines (I am using vast.ai).
Does someone have a fix for this?
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/12884#issuecomment-1701838715 This solved TypeError: 'type' object is not subscriptable.
I assume same I previously got this error also because of wrong py version.
Make sure you are on 3.10+
cd stable-diffusion-webui && source venv/bin/activate pip3 install httpx==0.24.1
It works for me! Thanks.
That worked for me, but I just needed that: pip3 install httpx==0.24.1
cd stable-diffusion-webui && source venv/bin/activate pip3 install httpx==0.24.1
It works for me! Thanks.
That worked for me, but I just needed that:
pip3 install httpx==0.24.1
hi, could you please explain where should i type those text?
cd stable-diffusion-webui && source venv/bin/activate pip3 install httpx==0.24.1
It works for me! Thanks.
That worked for me, but I just needed that:
pip3 install httpx==0.24.1
hi, could you please explain where should i type those text?
in terminal.
Also experiencing this bug for the first time today.
I have the same bug today. Anyone have advice how to solve it in Google Colab? TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument 'socket_options'
Ive tried some of the above but get syntax errors. Do I have to reinstall my entire Stable Diffusion/ Python environment?
I am a newbie, so treating me like the infant I am in explanations would be much appreciated. Thanks!
Hello! I have a NVIDIA Quadro RTX 6000, and i have the same error message : " TypeError: AsyncConnectionPool.init() got an unexpected keyword argument 'socket_options' ". I tried the solutions mentioned above but it doesn't seem to work for me. If anyone have an other solution that would be great. Thanks
in google colab add these 2 line work for me !pip install httpx==0.24.0 !pip install gradio --upgrade
in google colab add these 2 line work for me !pip install httpx==0.24.0 !pip install gradio --upgrade
And when it's not on google Colab? Because for me i run it locally and i tried everything but it doesn't work
Just had this issue. I installed it yesterday and it was working fine. I deleted venv and reinstalled today and it started giving me this error.
Can confirm this fixed it for me.
cd stable-diffusion-webui && source venv/bin/activate pip3 install httpx==0.24.1
I'm getting this same error/problem with a fresh install of automatic1111 after installing python 3.10.6. None of the above has worked. Any ideas much appreciated.
์ ๋ ์ด๋ฐ ๋ฐฉ๋ฒ์ผ๋ก ํด๊ฒฐ ํ๋ค /content/sd-webui/venv/lib/python3.10/site-packages/httpx/_transports/default.py
์์์ 275๋ฒ์งธ ์ค self._pool = httpcore.AsyncConnectionPool ๋ ์ ์ผ ์๋์ socket_options=socket_option
์ด์ค์ ์ ๊ฑฐ ํ๊ณ ๋๋ค์ ๋์๋ค
Line 275 in self._pool = httpcore.AsyncConnectionPool at the bottom of the column socket_options=socket_option
This happened after I removed this line:
venv "E:\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments:
Traceback (most recent call last):
File "E:\stable-diffusion-webui\launch.py", line 48, in
Same problem. Anyone know how to solve it?
E:\stable-diffusion-webui\venv\lib\site-packages\httpx_transports ๋ก ๊ฐ์๋ฉด default.py ์ด๋ ํ์ผ์ด ์๋๋ฐ ๊ทธ ํ์ด์ฌ ํ์ผ ํ ์คํธ๋ก ์ฌ์๊ณ
275๋ฒ์งธ ์ค๋ก๊ฐ๋ฉด self._pool = httpcore.AsyncConnectionPool( ์ด๋ ๋ด์ฉ์ด ์์ต๋๋ค.
๊ฑฐ๊ธฐ์ ์ ์ผ ์๋ซ์ค์ ๊ฐ๋ฉด socket_options = socket_option ์ธ๊ฐ ์ด๋ฐ ์ค ์๋๋ฐ ์ด ๋ถ๋ถ ์ง์ฐ์๊ณ ์คํํ๋ฉด ๋ฉ๋๋ค ์ ์ด๋ ๊ฒ ํด๊ฒฐ ํ์ต๋๋ค.
์ ๋ ์ด๋ฐ ๋ฐฉ๋ฒ์ผ๋ก ํด๊ฒฐ ํ๋ค /content/sd-webui/venv/lib/python3.10/site-packages/httpx/_transports/default.py
์์์ 275๋ฒ์งธ ์ค self._pool = httpcore.AsyncConnectionPool ๋ ์ ์ผ ์๋์ socket_options=socket_option
์ด์ค์ ์ ๊ฑฐ ํ๊ณ ๋๋ค์ ๋์๋ค
Line 275 in self._pool = httpcore.AsyncConnectionPool at the bottom of the column socket_options=socket_option
This happened after I removed this line:
Sorry, a bit new to this, but I don't know what you changed exactly? My file at Line 275 reads as:
self._pool = httpcore.AsyncConnectionPool( ssl_context=ssl_context, max_connections=limits.max_connections, max_keepalive_connections=limits.max_keepalive_connections, keepalive_expiry=limits.keepalive_expiry, http1=http1, http2=http2, uds=uds, local_address=local_address, retries=retries, socket_options=socket_options,
for me the issue was that automatically httpx 0.25.1 was installed, that don't work, the function prototype is different it doesn't have any socet_options argument, it has to be httpx 0.24.1
manually installing correct version worked for me
\stable-diffusion-webui> .\venv\Scripts\python.exe -m pip install httpx==0.24.1
So I'm thinking maybe there is something missing in requirements_versions.txt
for me the issue was that automatically httpx 0.25.1 was installed, that don't work, the function prototype is different it doesn't have any socet_options argument, it has to be httpx 0.24.1
manually installing correct version worked for me
\stable-diffusion-webui> .\venv\Scripts\python.exe -m pip install httpx==0.24.1
So I'm thinking maybe there is something missing in requirements_versions.txt
So you solved this issue ?
์ ๋ ์ด๋ฌํ ๋ฐฉ๋ฒ์ผ๋ก ์กฐ์น๋ฅผ ์ทจํ์ต๋๋ค /content/sd-webui/venv/lib/python3.10/site-packages/httpx/_transports/default.py 275๋ฒ์งธ ์ค self._pool = httpcore.AsyncConnectionPool ๋ ์ ์ผ ์๋์ ์์ผ_options=socket_option ์ด์ค์ ์ ๊ฑฐํ๊ณ ๋ ๋ค์ ์๋ self._pool์ 275ํ = httpcore.AsyncConnectionPool(์์ผ_์ต์ =์์ผ_์ต์ ์ด ํ๋จ) ์ด ์ค์ ์ ๊ฑฐํ ํ์ ์ด๋ฐ ์ผ์ด ์ผ์ด๋ฌ์ต๋๋ค.
์ฃ์กํฉ๋๋ค. ์กฐ๊ธ ์๋ก์ด ๋ด์ฉ์ ๋๋ค. ์ ํํ ๋ฌด์์ ๋ณ๊ฒฝํ๋์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. Line 275์ ์๋ ๋ด ํ์ผ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
self._pool = httpcore.asyncconnectionpool ( ssl_context = ssl_context, max_connections = limits.max_connections, max_keepalive_connection = limits.max_keepalive_connection, requal_expory = limits.keepalive_expory, http1 = http1. , uds = uds, local_address = local_address, retries = retries, ์์ผ_์ต์ =์์ผ_์ต์ ,
I removed this part =>์์ผ_์ต์ =์์ผ_์ต์
์ ๋ ์ด๋ฐ ๋ฐฉ๋ฒ์ผ๋ก ํด๊ฒฐ ํ๋ค /content/sd-webui/venv/lib/python3.10/site-packages/httpx/_transports/default.py ์์์ 275๋ฒ์งธ ์ค self._pool = httpcore.AsyncConnectionPool ๋ ์ ์ผ ์๋์ socket_options=socket_option ์ด์ค์ ์ ๊ฑฐ ํ๊ณ ๋๋ค์ ๋์๋ค Line 275 in self._pool = httpcore.AsyncConnectionPool at the bottom of the column socket_options=socket_option This happened after I removed this line:
Sorry, a bit new to this, but I don't know what you changed exactly? My file at Line 275 reads as:
self._pool = httpcore.AsyncConnectionPool( ssl_context=ssl_context, max_connections=limits.max_connections, max_keepalive_connections=limits.max_keepalive_connections, keepalive_expiry=limits.keepalive_expiry, http1=http1, http2=http2, uds=uds, local_address=local_address, retries=retries, socket_options=socket_options,
This worked! Thank you very much!
์ ๋ ์ด๋ฐ ๋ฐฉ๋ฒ์ผ๋ก ํด๊ฒฐํ์์ต๋๋ค /content/sd-webui/venv/lib/python3.10/site-packages/httpx/_transports/default.py ํด์ผ 275๋ฒ์งธ ์ค self._pool = httpcore.AsyncConnectionPool ๋ ์ ์ผ ์๋์ ์์ผ_options=socket_option ์ด์ค์ ์ ๊ฑฐํ๊ณ ๋ ๋ค์ ๋น ์ง ์ค 275 in self._pool = httpcore.AsyncConnectionPool ์ด ๋งจ ์๋์ ์๋ ์์ผ_options=socket_option ์ด ๋ฌธ์ ๋ ์ด ์ค์ ์ ๊ฑฐํ ํ์ ๋ฐ์ํ์ต๋๋ค.
์ฃ์กํฉ๋๋ค. ์กฐ๊ธ ์๋ก์ด ๋ด์ฉ์ ๋๋ค. ์ ํํ ๋ฌด์์ ๋ณ๊ฒฝํ๋์ง ๋ชจ๋ฅด๊ฒ ์ต๋๋ค. Line 275์ ์๋ ๋ด ํ์ผ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค. self._pool = httpcore.asyncconnectionpool (ssl_context = ssl_context, max_connections = limits.max_connections, max_keepalive_connection = limits.max_keepalive_connection, requal_expory = limits.keepalive_expory, http1 = http1. , uds = uds, local_address = local_address, retries = retries, ์์ผ_์ต์ =์์ผ_์ต์ ,
์ด๊ฒ์ด ํจ๊ณผ๊ฐ ์์์ต๋๋ค! ๋งค์ฐ ๊ฐ์ฌํฉ๋๋ค!
Haha thank you
So you solved this issue ?
only manually, need to test a proper fix, I think it should be as simple as setting correct version in requirements_versions.txt but my python-fu is weak so I'm unsure
E:\stable-diffusion-webui\venv\lib\site-packages\httpx_transports ๋ก ๊ฐ์๋ฉด default.py ์ด๋ ํ์ผ์ด ์๋๋ฐ ๊ทธ ํ์ด์ฌ ํ์ผ ํ ์คํธ๋ก ์ฌ์๊ณ
275๋ฒ์งธ ์ค๋ก๊ฐ๋ฉด self._pool = httpcore.AsyncConnectionPool( ์ด๋ ๋ด์ฉ์ด ์์ต๋๋ค.
๊ฑฐ๊ธฐ์ ์ ์ผ ์๋ซ์ค์ ๊ฐ๋ฉด socket_options = socket_option ์ธ๊ฐ ์ด๋ฐ ์ค ์๋๋ฐ ์ด ๋ถ๋ถ ์ง์ฐ์๊ณ ์คํํ๋ฉด ๋ฉ๋๋ค ์ ์ด๋ ๊ฒ ํด๊ฒฐ ํ์ต๋๋ค.
์ด๋ ๊ฒ ํ๋๊น ๋๋ค! ๊ณ ๋ง์
E:\stable-diffusion-webui\venv\lib\site-packages\httpx_transports ๋ก ๊ฐ์๋ฉด default.py ์ด๋ ํ์ผ์ด ์๋๋ฐ ๊ทธ ํ์ด์ฌ ํ์ผ ํ ์คํธ๋ก ์ฌ์๊ณ
275๋ฒ์งธ ์ค๋ก๊ฐ๋ฉด self._pool = httpcore.AsyncConnectionPool( ์ด๋ ๋ด์ฉ์ด ์์ต๋๋ค.
๊ฑฐ๊ธฐ์ ์ ์ผ ์๋ซ์ค์ ๊ฐ๋ฉด socket_options = socket_option ์ธ๊ฐ ์ด๋ฐ ์ค ์๋๋ฐ ์ด ๋ถ๋ถ ์ง์ฐ์๊ณ ์คํํ๋ฉด ๋ฉ๋๋ค ์ ์ด๋ ๊ฒ ํด๊ฒฐ ํ์ต๋๋ค.
์ด๋ ๊ฒ ํ๋๊น ๋๋ค! ๊ณ ๋ง์
๋ชจ์! ๋ด๊ฐ ๋จผ์ ๋ฐ๊ฒฌ ํ๋ค๊ตฌ์ฐ!
E:\stable-diffusion-webui\venv\lib\site-packages\httpx_transports ๋ก ๊ฐ์๋ฉด default.py ์ด๋ ํ์ผ์ด ์๋๋ฐ ๊ทธ ํ์ด์ฌ ํ์ผ ํ ์คํธ๋ก ์ฌ์๊ณ
275๋ฒ์งธ ์ค๋ก๊ฐ๋ฉด self._pool = httpcore.AsyncConnectionPool( ์ด๋ ๋ด์ฉ์ด ์์ต๋๋ค.
๊ฑฐ๊ธฐ์ ์ ์ผ ์๋ซ์ค์ ๊ฐ๋ฉด socket_options = socket_option ์ธ๊ฐ ์ด๋ฐ ์ค ์๋๋ฐ ์ด ๋ถ๋ถ ์ง์ฐ์๊ณ ์คํํ๋ฉด ๋ฉ๋๋ค ์ ์ด๋ ๊ฒ ํด๊ฒฐ ํ์ต๋๋ค.
thank you very much!!
yes, I think this fix works, who usually reviews and merges pull requests around here?
oh well, someone will get around to it I'm sure
E:\stable-diffusion-webui\venv\lib\site-packages\httpx_transports ๋ก์๋ฉด default.py ์ด๋ ํ์ผ์ด ์ฎ์ธ ํ์ผ ํ ์คํธ๋ก ์ฌ์๊ณ
275๋ฒ์งธ ์ค๋ก๊ฐ๋ฉด self._pool = httpcore.AsyncConnectionPool( ์ด๋ ๋ด์ฉ์ด ์์ต๋๋ค.
์ ๊ธฐ์ ์ ์ผ์ค์ ํ์ธํธ ์์ผ_options = ์์ผ_์ต์ ์ธ๊ฐ ์ด๋ฐ ์ค ์ด ๋ถ๋ถ ์๋ฆฌํ๊ณ ์คํํ๋ฉด ์ ์ด๋ ๊ฒ ์ฒ๋ฆฌํ์ต๋๋ค.
E:\stable-diffusion-webui\venv\lib\site-packages\httpx_transports ๋ก์๋ฉด default.py ์ด๋ ํ์ผ์ด ์ฎ์ธ ํ์ผ ํ ์คํธ๋ก ์ฌ์๊ณ
275๋ฒ์งธ ์ค๋ก๊ฐ๋ฉด self._pool = httpcore.AsyncConnectionPool( ์ด๋ ๋ด์ฉ์ด ์์ต๋๋ค.
์ ๊ธฐ์ ์ ์ผ์ค์ ํ์ธํธ ์์ผ_options = ์์ผ_์ต์ ์ธ๊ฐ ์ด๋ฐ ์ค ์ด ๋ถ๋ถ ์๋ฆฌํ๊ณ ์คํํ๋ฉด ์ ์ด๋ ๊ฒ ์ฒ๋ฆฌํ์ต๋๋ค.
์, ์ด ๋ถ๋ถ์ ํน์ง์ด ํจ๊ณผ๊ฐ ์๋ค๊ณ ์๊ฐํฉ๋๋ค. ์ผ๋ฐ์ ์ผ๋ก ์ฌ๊ธฐ์์ ํ ์์ฒญ์ ๊ฒํ ํ๊ณ ์์ถํ๋ ์ฌ๋์ ๋๊ตฌ์ ๋๊น?
์์ผ ๋ญ, ๋ญ์ผ?
We will find a way. we always have.
ah, change already made, get latest should be problem solved
I just solved the problem with the command above. !pip install httpx==0.24.1
cd stable-diffusion-webui && source venv/bin/activate pip3 install httpx==0.24.1
For future messups, one can simply just add "httpx==0.24.1" to requirements.txt, right?
I'm trying to run it on CPU in huggingface and got the same error but changing it in the requirements results in a build error. Version httpcore==0.24.1 is unavailable from the list of versions 0.01-1.0.2
I am not a coding guy, but i've read this thread and tried to repeat the process from @huntchar
And it helps in my case.
Open file: \stable-diffusion-webui\venv\Lib\site-packages\httpx_transports\default.py Search line 275.
Code looks like that:
self._pool = httpcore.AsyncConnectionPool(
ssl_context=ssl_context,
max_connections=limits.max_connections,
max_keepalive_connections=limits.max_keepalive_connections,
keepalive_expiry=limits.keepalive_expiry,
http1=http1,
http2=http2,
uds=uds,
local_address=local_address,
retries=retries,
socket_options=socket_options,
Remove last line, socket_options=socket_options, save the file. Restart SD.
For anybody that is experiencing this problem on Windows, open a CMD in your main SD web-ui folder, then run these two commands:
venv\Scripts\activate.bat
pip install httpx==0.24.1
Does not work for me:
source venv/bin/activate
pip3 install httpx==0.24.1
lib/python3.10/site-packages/httpx/_transports/default.py", line 275, in init self._pool = httpcore.AsyncConnectionPool( TypeError: AsyncConnectionPool.init() got an unexpected keyword argument 'socket_options'
I fixed it with
pip install -U pip pip install -U httpcore
where am i uspposed to type this?
no funciona ni una solucion, bravo, inservible
la unica manera de arraglar esto es seleccionar la carpetira y SUPRIMIR; listo, se acabรณ el problema, cortar el sida este que no funciona ๐
pip3 install httpx==0.24.1
This fixed sd web for me. With the issue "TypeError: AsyncConnectionPool.init() got an unexpected keyword argument 'socket_options'"
I have the same problem, tried all of the suggestions above. TypeError: AsyncConnectionPool.init() got an unexpected keyword argument 'socket_options' Press any key to continue . . .
Is there an existing issue for this?
What happened?
Clone this repository (1.6) and it doesn't work.
Steps to reproduce the problem
What should have happened?
The model should run...
Sysinfo
Ubuntu20.04
What browsers do you use to access the UI ?
No response
Console logs
Additional information
No response