ImportError: cannot import name 'X' from 'gradio' (inputs, Box, IOComponent, ChatInterface, ...): which releases have it
Most of these errors come from gradio 4.0.0 (2023-10-31), which removed gr.inputs, gr.outputs, Box, Carousel, Variable, StatusTracker, interpretation and 13 more top-level names, and IOComponent from gradio.components; 3.50.2 is the last release that has them. Replace gr.inputs.Textbox(...) with gr.Textbox(...) (the same for every input and output class), Variable with State and Carousel with Gallery. To run old code unchanged, pin pip install "gradio<4.0.0"; on a Hugging Face Space the gradio version comes from sdk_version in the Space's README.md. The opposite error, a new name on an old gradio, means upgrading: ChatInterface needs 3.37.0, ChatMessage 4.38.0. For any other name, in any module of gradio, paste the error below.
Corrected on 2026-12-05: this page read only the first release of each minor version, so a name added or removed in a patch release was dated to the next minor. For example, gr.Component is in 5.13.2 (2025-01-29), not only from 5.14.0. Every release was then read once from PyPI: 40 top-level names (and 644 module-and-name pairs in all) differ in some patch release from the release this page read for the same minor. The lookup now gives those patch releases. The per-minor ranges and the tables are unchanged.
Examples:
Runs in your browser on gradio.json (185 KB); nothing you paste is sent anywhere. Covers 246 top-level names and 6,066 module-and-name pairs in 213 modules.
What did gradio 4.0.0 remove, and what replaces each name?
These 21 names left from gradio import ... (and gr.X) in 4.0.0, together with gradio.components.IOComponent. Where gradio named a replacement, it is quoted from the deprecation messages of 3.50.2; the lookup shows the same hints.
| Removed in 4.0.0 | Use instead |
|---|---|
gr.inputs | the components themselves: gr.Textbox(), gr.Image() and so on. gradio 3.50.2 said: "Usage of gradio.inputs is deprecated, and will not be supported in the future, please import your component from gradio.components". |
gr.outputs | the components themselves (gr.Textbox(), gr.Label(), ...); gradio.outputs was deprecated in 3.50.2 like gradio.inputs. |
gr.Box | no named replacement; 3.50.2 marks Box "DEPRECATED". gr.Group() or gr.Column() are the layouts that remain. |
gr.Carousel | gr.Gallery(). gradio 3.50.2 said: "The Carousel component is deprecated. Please consider using the Gallery component". |
gr.Variable | gr.State(). gradio 3.50.2 said: "Variable was renamed to State". |
gr.StatusTracker | nothing; it was deprecated in 3.50.2 and removed. |
gr.Webcam | gr.Image(sources=["webcam"]) (4.0.0 renamed source to sources). |
gr.Interpretation | nothing; gradio 4.0.0 removed interpretation. |
gr.interpretation | nothing; gradio 4.0.0 removed interpretation. |
gr.Parallel | nothing in gradio; Parallel and Series (gradio.mix) were removed in 4.0.0. |
gr.Series | nothing in gradio; Parallel and Series (gradio.mix) were removed in 4.0.0. |
gradio.components.IOComponent | gradio.components.Component (custom components subclass it from 4.0.0). |
gradio 5.0.0 (2024-10-09) removed make_waveform and HuggingFaceDatasetSaver (and LogoutButton) from the top level; 4.44.1 is the last release with them.
Which gradio release added the newer names?
"cannot import name" for a name that appears in current examples means the installed gradio is too old. The first release of each minor version that has the name:
| Name | First release | Date (PyPI) |
|---|---|---|
gr.ChatInterface | 3.37.0 | 2023-07-17 |
gr.LoginButton | 3.40.0 | 2023-08-10 |
gr.on | 3.45.0 | 2023-09-26 |
gr.http_server | 4.23.0 | 2024-03-25 |
gr.render | 4.31.0 | 2024-05-10 |
gr.ChatMessage | 4.38.0 | 2024-07-12 |
gr.load_chat | 5.10.0 | 2025-01-07 |
gr.Sidebar | 5.14.0 | 2025-01-30 |
gr.Navbar | 5.45.0 | 2025-09-10 |
gr.Server | 6.10.0 | 2026-03-24 |
What did each gradio release remove from gradio and gradio.components?
41 of the 246 names that from gradio import has ever accepted are gone from 6.32.0. 32 of the 213 modules that have existed are gone as well; paste No module named 'gradio...' into the lookup for any of them. Names that gradio.components only passed along from other packages (typing names, numpy, PIL and similar) are left out of this table but are in the lookup.
| Release | Date (PyPI) | Module | Names | Removed names |
|---|---|---|---|---|
| 6.0.0 | 2025-11-21 | gradio | 1 | sketch |
| 5.46.0 | 2025-09-16 | gradio | 2 | IS_WASM, wasm_utils |
| 5.26.0 | 2025-04-23 | gradio | 1 | strings |
| 5.0.0 | 2024-10-09 | gradio | 3 | HuggingFaceDatasetSaver, LogoutButton, make_waveform |
| 5.0.0 | 2024-10-09 | gradio.components | 1 | LogoutButton |
| 4.37.1 | 2024-06-25 | gradio | 1 | analytics_dashboard |
| 4.0.0 | 2023-10-31 | gradio | 21 | Box, Carousel, HuggingFaceDatasetJSONSaver, ImagePaint, Interpretation, Parallel, Pil, Series, StatusTracker, TimeSeries, Timeseries, Variable, Webcam, cli_env_info, deploy_space, deprecation, inputs, interpretation, mix, outputs, reload |
| 4.0.0 | 2023-10-31 | gradio.components | 9 | Carousel, Column, IOComponent, Interpretation, Row, StatusTracker, TimeSeries, Timeseries, Variable |
| 3.45.0 | 2023-09-26 | gradio | 2 | current_pkg_version, pkgutil |
| 3.35.0 | 2023-06-15 | gradio.components | 32 | AltairPlot, Block, BlockContext, Blurrable, BooleanSerializable, Changeable, Clearable, Clickable, Editable, EventListener, EventListenerMethod, FileData, FileSerializable, GallerySerializable, ImgSerializable, Inputable, JSONSerializable, ListStringSerializable, NeighborInterpretable, NumberSerializable, Playable, Releaseable, Selectable, Serializable, SimpleSerializable, Streamable, StringSerializable, Submittable, TokenInterpretable, Uploadable, VideoSerializable, _Image |
| 3.26.0 | 2023-04-13 | gradio | 1 | media_data |
| 3.25.0 | 2023-04-10 | gradio | 1 | documentation |
| 3.24.0 | 2023-03-30 | gradio | 1 | serializing |
| 3.21.0 | 2023-03-14 | gradio | 1 | encryptor |
| 3.16.0 | 2023-01-05 | gradio | 3 | dataclasses, examples, queue |
| 3.1.0 | 2022-07-19 | gradio | 3 | load_interface, pkg_resources, process_examples |
How do I read the error?
- On a Hugging Face Space, the gradio version is the
sdk_versionin the Space's README.md, not whatrequirements.txtsays. A Space that stopped working after a rebuild usually got a newer gradio there. - The path in parentheses is the copy of gradio that was imported. If it points into your project (a file named
gradio.py), rename yours. - The module after "from" decides which table applies:
from 'gradio'is the top level,from 'gradio.components'that module. When the import is in another package (an extension or an old app template), upgrade or pin gradio to the range that package was written for.
How was this read, and how was it checked?
From the source of each release, with Python's ast module; no release was installed or imported. gradio's git tags (gradio@X.Y.Z) start at 3.41.0; for 3.0 to 3.40 the package files were read from the wheels on PyPI (only the needed parts of each wheel, by HTTP range requests). gradio imports eagerly, so a module's names are everything it binds at module level: classes, functions, assignments, imports, and what from .x import * brings in. Code under if TYPE_CHECKING: is skipped. Dates come from PyPI.
Checks, by a second reading of the same files: (1) each of the 236 top-level names read from the git tags is found as plain text in __init__.py (or the modules it star-imports) in every release of its range (26,624 name-and-release pairs with the wheel part), and is not imported there in the release on either side (128 edges). (2) A regular expression finds 29,937 definitions in 3,331 file versions; all are among the names read. (3) Against a different source, the wheels on PyPI, 22 release checks of the facts on this page agree:
| Name | Release | Wheel and data |
|---|---|---|
gradio.inputs | 3.50.2 | has it |
gradio.inputs | 4.0.0 | does not |
gradio.outputs | 3.50.2 | has it |
gradio.outputs | 4.0.0 | does not |
gradio.Box | 3.50.2 | has it |
gradio.Box | 4.0.0 | does not |
gradio.Interpretation | 3.50.2 | has it |
gradio.Interpretation | 4.0.0 | does not |
gradio.components.IOComponent | 3.50.2 | has it |
gradio.components.IOComponent | 4.0.0 | does not |
gradio.make_waveform | 4.44.1 | has it |
gradio.make_waveform | 5.0.0 | does not |
gradio.HuggingFaceDatasetSaver | 4.44.1 | has it |
gradio.HuggingFaceDatasetSaver | 5.0.0 | does not |
gradio.ChatInterface | 3.37.0 | has it |
gradio.ChatInterface | 3.36.1 | does not |
gradio.http_server | 4.23.0 | has it |
gradio.http_server | 4.22.0 | does not |
gradio.ChatMessage | 4.38.0 | has it |
gradio.ChatMessage | 4.37.2 | does not |
gradio.Sidebar | 5.14.0 | has it |
gradio.Sidebar | 5.13.2 | does not |
Limits
- Nothing was installed or run. "Has it" means the import statement resolves in the source.
- The ranges use the first release of each minor version (and the newest). Every release was also read once (302 releases, from the wheels on PyPI by HTTP range requests, with the same rules): 40 top-level names and 644 module-and-name pairs in all differ in some patch release from the release read for their minor. The lookup prints those patch releases under the range.
- Releases before 3.0.1 are not covered.
- Errors that are not about import names, such as a component argument that was renamed (
sourcetosourcesin 4.0.0), are not covered.
Questions
How do I fix "cannot import name 'inputs' from 'gradio'" (or 'outputs')?
gradio 4.0.0 (2023-10-31) removed gradio.inputs and gradio.outputs; 3.50.2 is the last release with them. Replace gr.inputs.Textbox(...) with gr.Textbox(...), gr.outputs.Label(...) with gr.Label(...), and so on, as the 3.50.2 deprecation message said. To run the old code unchanged, pin pip install "gradio<4.0.0"; on a Hugging Face Space, set sdk_version in README.md.
How do I fix "cannot import name 'IOComponent' from 'gradio.components'"?
IOComponent was removed in gradio 4.0.0 (3.50.2 is the last release with it). Code that subclasses it, usually a custom component or an old extension, has to subclass gradio.components.Component instead, or pin gradio<4.0.0.
Why does "from gradio import ChatInterface" fail?
Your gradio is older than 3.37.0, the first release (of each minor version read) that has ChatInterface. Upgrade gradio. The same holds for ChatMessage (4.38.0), Sidebar (5.14.0) and the other names in the table of additions.
gradio fails with "cannot import name 'HfFolder' from 'huggingface_hub'". Is that gradio's fault?
It is the combination: gradio 4.9.0 to 5.7.x import HfFolder, which huggingface_hub 1.0.0 removed. Upgrade gradio to 5.8.0 or later, or pin huggingface_hub below 1.0.0. The huggingface_hub page on this site has the details.
Does this page cover gradio.components, gradio.utils and the other modules?
Yes: every module of gradio from 3.0.1 to 6.32.0, 6,066 module-and-name pairs in 213 modules.
Sources
- gradio-app/gradio, release tags gradio@3.41.0 to gradio@6.32.0: every
.pyfile under gradio/; gradio 3.0.1 to 3.40.0 from the wheels on PyPI, which also gives the release dates. - Deprecation messages quoted: inputs.py at 3.50.2, components/carousel.py, components/state.py, layouts.py (Box).
The same data as JSON: gradio.json, licensed CC BY 4.0.
Related: "cannot import name 'HfFolder' from 'huggingface_hub'" (gradio 4.9.0 to 5.7.x) · "... from 'transformers'" · "... from 'diffusers'" · "... from 'datasets'".