# How to solve this problem? I can't implement gradio

**URL:** <https://discuss.huggingface.co/t/how-to-solve-this-problem-i-cant-implement-gradio/63706>\
**Category:** 🔒 Gradio\
**Created:** [November 27, 2023, 12:32pm UTC](https://discuss.huggingface.co/t/how-to-solve-this-problem-i-cant-implement-gradio/63706 "2023-11-27T12:32:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryugn123](https://avatars.discourse-cdn.com/v4/letter/r/47e85d/32.png) [@ryugn123](https://discuss.huggingface.co/u/ryugn123)\
**Post date:** [November 27, 2023, 12:32pm UTC](https://discuss.huggingface.co/t/how-to-solve-this-problem-i-cant-implement-gradio/63706/1 "2023-11-27T12:32:26Z")

</div>

ImportError Traceback (most recent call last)  
 in \<cell line: 3\>()  
1 from langchain.chat\_models import ChatOpenAI  
2 from langchain.schema import AIMessage, HumanMessage, SystemMessage  
----\> 3 import gradio as gr  
4  
5 def response(message, chat\_history):

13 frames  
/usr/local/lib/python3.10/dist-packages/fastapi/exceptions.py in   
4 from starlette.exceptions import HTTPException as StarletteHTTPException  
5 from starlette.exceptions import WebSocketException as StarletteWebSocketException  
----\> 6 from typing\_extensions import Annotated, Doc # type: ignore [attr-defined]  
7  
8

ImportError: cannot import name ‘Doc’ from ‘typing\_extensions’ (/usr/local/lib/python3.10/dist-packages/typing\_extensions.py)

---

<div class="post-metadata">

**Author:** ![henrykohl](https://avatars.discourse-cdn.com/v4/letter/h/ecccb3/32.png) [@henrykohl](https://discuss.huggingface.co/u/henrykohl)\
**Post date:** [December 3, 2023, 12:13pm UTC](https://discuss.huggingface.co/t/how-to-solve-this-problem-i-cant-implement-gradio/63706/2 "2023-12-03T12:13:56Z")

</div>

I had the same issue in Colab. My code is as follows

```auto
!pip install -q gradio
import gradio

```

I try to run the same code in Kaggle. There are some Warning messages:  
“ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts…”  
I modified my code:

```auto
!pip install -q gradio --use-deprecated=legacy-resolver

```

Everything is fine.

---

<div class="post-metadata">

**Author:** ![henrykohl](https://avatars.discourse-cdn.com/v4/letter/h/ecccb3/32.png) [@henrykohl](https://discuss.huggingface.co/u/henrykohl)\
**Post date:** [December 7, 2023, 3:03am UTC](https://discuss.huggingface.co/t/how-to-solve-this-problem-i-cant-implement-gradio/63706/3 "2023-12-07T03:03:20Z")

</div>

Oh! I got a solution from CSDN. It can fix the above error in Colab. Try to install gradio with the version of 3.45.0.

```auto
!pip install -q gradio==3.45.0

```
