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

TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument 'socket_options' #13847

Closed
1 task done
kkget opened this issue Nov 4, 2023 · 29 comments
Closed
1 task done
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@kkget
Copy link

kkget commented Nov 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

image

Steps to reproduce the problem

start

What should have happened?

image

Sysinfo

windows

What browsers do you use to access the UI ?

No response

Console logs

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
Version: v1.6.0
Commit hash: 5ef669de080814067961f28357256e8fe27544f4
Launching Web UI with arguments: --theme dark --xformers --upcast-sampling --no-half-vae --opt-channelslast --api --autolaunch
Traceback (most recent call last):
  File "E:\sd-webui-aki\sd-webui-aki-v4\launch.py", line 48, in <module>
    main()
  File "E:\sd-webui-aki\sd-webui-aki-v4\launch.py", line 44, in main
    start()
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\launch_utils.py", line 432, in start
    import webui
  File "E:\sd-webui-aki\sd-webui-aki-v4\webui.py", line 13, in <module>
    initialize.imports()
  File "E:\sd-webui-aki\sd-webui-aki-v4\modules\initialize.py", line 21, in imports
    import gradio  # noqa: F401
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\__init__.py", line 3, in <module>
    import gradio.components as components
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\components\__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\components\annotated_image.py", line 12, in <module>
    from gradio import utils
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\utils.py", line 353, in <module>
    class AsyncRequest:
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\gradio\utils.py", line 372, in AsyncRequest
    client = httpx.AsyncClient()
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\httpx\_client.py", line 1397, in __init__
    self._transport = self._init_transport(
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\httpx\_client.py", line 1445, in _init_transport
    return AsyncHTTPTransport(
  File "E:\sd-webui-aki\sd-webui-aki-v4\py310\lib\site-packages\httpx\_transports\default.py", line 275, in __init__
    self._pool = httpcore.AsyncConnectionPool(
TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument 'socket_options'
提示:Python 运行时抛出了一个异常。请检查疑难解答页面。

--------

[程序崩溃,退出代码为 1 (0x00000001)]

Additional information

No response

@kkget kkget added the bug-report Report of a bug, yet to be confirmed label Nov 4, 2023
@kkget
Copy link
Author

kkget commented Nov 4, 2023

I tried add httpx==0.24.1 to requirements , but not work

@kkget
Copy link
Author

kkget commented Nov 4, 2023

I tried but not work
.\venv\Scripts\Activate.ps1
pip install httpx==0.24.1

@kkget
Copy link
Author

kkget commented Nov 4, 2023

image

@kkget
Copy link
Author

kkget commented Nov 4, 2023

image
I tried but not work
venv\Scripts\activate
pip install httpx==0.24.1

@wongyibin
Copy link

我也遇到了同样的问题,你解决这个问题了吗?(I met the same error , have you sloved this error?)

@kkget
Copy link
Author

kkget commented Nov 4, 2023

I have resolved and started working

@oumingyang
Copy link

oumingyang commented Nov 4, 2023

I resolved this probiem by comment the code, version 0.25.1
ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env)

    if proxy is None:
        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,
        )
    elif proxy.url.scheme in ("http", "https"):
        self._pool = httpcore.AsyncHTTPProxy(
            proxy_url=httpcore.URL(
                scheme=proxy.url.raw_scheme,
                host=proxy.url.raw_host,
                port=proxy.url.port,
                target=proxy.url.raw_path,
            ),
            proxy_auth=proxy.raw_auth,
            proxy_headers=proxy.headers.raw,
            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,
            # socket_options=socket_options,
        )

@kkget
Copy link
Author

kkget commented Nov 4, 2023

i have resolve the problem thank you~~

@wongyibin
Copy link

How did you resolve this issue? thank you~

@wongyibin
Copy link

I tried to implement the solution mentioned above to address the issue, but I encountered an error while running it. Can you provide me with your solution?

@46562002
Copy link

46562002 commented Nov 4, 2023

I also had the same trouble...
Help!
Y(>_<、)Y

@kkget
Copy link
Author

kkget commented Nov 4, 2023

How did you resolve this issue? thank you~
you can refren it
I resolved is #13236
and i use an intergration package, and updated version

@kkget
Copy link
Author

kkget commented Nov 4, 2023

我也遇到了同样的问题,你解决这个问题了吗?(I met the same error , have you sloved this error?)

you can updated your aki

@wongyibin
Copy link

I resolved this probiem by comment the code, version 0.25.1 ssl_context = create_ssl_context(verify=verify, cert=cert, trust_env=trust_env)

    if proxy is None:
        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,
        )
    elif proxy.url.scheme in ("http", "https"):
        self._pool = httpcore.AsyncHTTPProxy(
            proxy_url=httpcore.URL(
                scheme=proxy.url.raw_scheme,
                host=proxy.url.raw_host,
                port=proxy.url.port,
                target=proxy.url.raw_path,
            ),
            proxy_auth=proxy.raw_auth,
            proxy_headers=proxy.headers.raw,
            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,
            # socket_options=socket_options,
        )

that‘s work, thank you

@ZMOT7S
Copy link

ZMOT7S commented Nov 5, 2023

Fixed by adding "httpx==0.24.1" to requirements_versions.txt.

@Rocksvel
Copy link

Rocksvel commented Nov 6, 2023

I did everything according to the guide, but I had another problem

C:\Steble Diffusion\stable-diffusion-webui-directml>git pull
Already up to date.
venv "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: 1.6.0
Commit hash: 64e6b06
Launching Web UI with arguments: --autolaunch--opt-sub-quad-attention --lowvram --disable-nan-check
Traceback (most recent call last):
File "C:\Steble Diffusion\stable-diffusion-webui-directml\launch.py", line 48, in
main()
File "C:\Steble Diffusion\stable-diffusion-webui-directml\launch.py", line 44, in main
start()
File "C:\Steble Diffusion\stable-diffusion-webui-directml\modules\launch_utils.py", line 676, in start
import webui
File "C:\Steble Diffusion\stable-diffusion-webui-directml\webui.py", line 13, in
initialize.imports()
File "C:\Steble Diffusion\stable-diffusion-webui-directml\modules\initialize.py", line 21, in imports
import gradio # noqa: F401
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio_init_.py", line 3, in
import gradio.components as components
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\components_init_.py", line 1, in
from gradio.components.annotated_image import AnnotatedImage
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio\components\annotated_image.py", line 8, in
from gradio_client.documentation import document, set_documentation_group
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio_client_init_.py", line 1, in
from gradio_client.client import Client
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio_client\client.py", line 32, in
from gradio_client import serializing, utils
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio_client\serializing.py", line 11, in
from gradio_client import media_data, utils
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\gradio_client\utils.py", line 22, in
import httpx
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\httpx_init_.py", line 2, in
from ._api import delete, get, head, options, patch, post, put, request, stream
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\httpx_api.py", line 4, in
from ._client import Client
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\httpx_client.py", line 30, in
from ._transports.default import AsyncHTTPTransport, HTTPTransport
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\httpx_transports\default.py", line 32, in
from .._config import DEFAULT_LIMITS, Limits, proxy, create_ssl_context
ImportError: cannot import name 'proxy' from 'httpx._config' (C:\Steble Diffusion\stable-diffusion-webui-directml\venv\lib\site-packages\httpx_config.py)

import logging
import os
import ssl
import typing
from pathlib import Path

import certifi

from ._compat import set_minimum_tls_version_1_2
from ._models import Headers
from ._types import CertTypes, HeaderTypes, TimeoutTypes, URLTypes, VerifyTypes
from ._urls import URL
from ._utils import get_ca_bundle_from_env

Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.

= RESTART: C:\Steble Diffusion\stable-diffusion-webui-directml\venv\Lib\site-packages\httpx_config.py
Traceback (most recent call last):
File "C:\Steble Diffusion\stable-diffusion-webui-directml\venv\Lib\site-packages\httpx_config.py", line 9, in
from ._models import Headers
ImportError: attempted relative import with no known parent package

@Rocksvel
Copy link

Rocksvel commented Nov 6, 2023

please help me trying to find a solution for 5 hours

@catboxanon
Copy link
Collaborator

Duplicate of #13840

@ghost
Copy link

ghost commented Nov 18, 2023

https://youtu.be/DgVEinaEKOw?si=KieTgvGuNY09LnRZ

@sy-bee
Copy link

sy-bee commented Nov 21, 2023

For everyone ending up in this issue and who uses Poetry: the solution is to also upgrade the httpcore package if it's below version 1.0.0

@peerlessXu
Copy link

winows11,I have resolve the problem by this:

source venv/Scripts/activate 
pip install httpx==0.24.1

@xddun
Copy link

xddun commented Dec 2, 2023

Linux :
source venv/bin/activate
pip install httpx==0.24.1

windows:
source venv/Scripts/activate
pip install httpx==0.24.1

@konadakona
Copy link

Fixed by adding "httpx==0.24.1" to requirements_versions.txt.

it worked for me, thank you

@haringro
Copy link

haringro commented Dec 9, 2023

You need to add the line httpx==0.24.1 to the requirements file. But you need to make sure to use the right one. I am use the directml fork. So I had to add the line to the file requirements_onnx.txt.

@sev7n4
Copy link

sev7n4 commented Dec 11, 2023

need to add the line httpx==0.24.1 to the requirements file. But you need to make sure to use the right one. I am use the directml fork. So I had to add the line to the file requirements_onnx.txt.

thanks ,use put the below info at the end of the file in requirements_versions.txt,and it is work
source venv/bin/activate
pip install httpx==0.24.1

@hokins1490
Copy link

winows11,I have resolve the problem by this:

source venv/Scripts/activate 
pip install httpx==0.24.1

Please tell me what exactly needs to be done about this? I have pasted this into the cmd and into the requirements.txt and requirements_versions.txt files, but it has no effect.

@ameeuwsen
Copy link

Fixed by adding "httpx==0.24.1" to requirements_versions.txt.

This worked for me. Thank you!

@dlovep
Copy link

dlovep commented Mar 4, 2024

This link is proper fix for those not working
#13840

@DioJoestarr
Copy link

Fixed by adding "httpx==0.24.1" to requirements_versions.txt.

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests