Space: AttributeError: module 'gradio' has no attribute 'Sidebar'

I have this error when I trying to build my space:

===== Application Startup at 2025-03-31 15:51:38 =====

Traceback (most recent call last):
File “/home/user/app/app.py”, line 95, in
GradioUI(agent).launch()
File “/usr/local/lib/python3.10/site-packages/smolagents/gradio_ui.py”, line 265, in launch
with gr.Sidebar():
AttributeError: module ‘gradio’ has no attribute ‘Sidebar’
Traceback (most recent call last):
File “/home/user/app/app.py”, line 95, in
GradioUI(agent).launch()
File “/usr/local/lib/python3.10/site-packages/smolagents/gradio_ui.py”, line 265, in launch
with gr.Sidebar():
AttributeError: module ‘gradio’ has no attribute ‘Sidebar’

my requirement.txt:

huggingface_hub>=0.28.0

smolagents>=1.12.0

python-dotenv==1.1.0

sqlalchemy==2.0.40

gradio>=5.23.1

I am trying to build my first agents system. but this gradio error kept persisting. What could i have gone wrong here?

1 Like

At least, the Gradio version of README.md takes precedence over requirements.txt with regard to the GUI, so it is possible that it is out of date.

sdk_version: 5.15.0

1 Like

Thanks for the correct direction, I changed it to 5.15 but it threw some errors so I put it to 5.23.2

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.