Problem while deploying the app on Hugging Face spaces

Hi currently i am trying to deploy an app in the hugging face space but i am getting this error any suggestion how to solve it ?

i already have updated gradio and httpx but still error is same ?

Traceback (most recent call last):
  File "/home/user/app/app.py", line 4, in <module>
    import gradio as gr
  File "/home/user/.local/lib/python3.10/site-packages/gradio/__init__.py", line 3, in <module>
    import gradio.components as components
  File "/home/user/.local/lib/python3.10/site-packages/gradio/components.py", line 39, in <module>
    from gradio.blocks import Block
  File "/home/user/.local/lib/python3.10/site-packages/gradio/blocks.py", line 19, in <module>
    from gradio import (
  File "/home/user/.local/lib/python3.10/site-packages/gradio/event_queue.py", line 11, in <module>
    from gradio.utils import Request, run_coro_in_background
  File "/home/user/.local/lib/python3.10/site-packages/gradio/utils.py", line 384, in <module>
    class Request:
  File "/home/user/.local/lib/python3.10/site-packages/gradio/utils.py", line 404, in Request
    client = httpx.AsyncClient()
  File "/home/user/.local/lib/python3.10/site-packages/httpx/_client.py", line 1397, in __init__
    self._transport = self._init_transport(
  File "/home/user/.local/lib/python3.10/site-packages/httpx/_client.py", line 1445, in _init_transport
    return AsyncHTTPTransport(
  File "/home/user/.local/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'

hi @5m4ck3r can you please try it again adding a pre-requirements.txt text file with pip==23.3.1?

1 Like

Nop its not working :frowning: but when i add

os.system("pip uninstall -y gradio")
os.system("pip install gradio==2.6.4")

Then its working fine …

Can you please try to add

gradio==3.45.0

in requirements.txt?
It’s working fine…

3 Likes

I had a similar problem and this didn’t work for me. For my situation I removed my hard coded Gradio version (3.1.4?) and left the default (version 4.12.0). I also changed my python from version 3.9.13 to 3.9.17. This worked for me.