gradio-app / gradio

Build and share delightful machine learning apps, all in Python. ๐ŸŒŸ Star to support our work!
http://www.gradio.app
Apache License 2.0
34.22k stars 2.6k forks source link

Bug Report: Custom Component Fails to Load in Gradio App #9266

Open oreoluwa212 opened 2 months ago

oreoluwa212 commented 2 months ago

Describe the bug

Have you searched existing issues? ๐Ÿ”Ž

Reproduction

import gradio as gr
from gradio_mycomponent import MyComponent

example = MyComponent().example_value()

demo = gr.Interface(
    lambda x:x,
    MyComponent(),  # interactive version of your component
    MyComponent(),  # static version of your component
    # examples=[[example]],  # uncomment this line to view the "example version" of your component
)

if __name__ == "__main__":
    demo.launch()

Screenshot

04 09 2024_03 00 31_REC 127 0 0 1_7860_

Logs

No response

System Info

Gradio Environment Information:
------------------------------ 
Operating System: Windows
gradio version: 4.42.0
gradio_client version: 1.3.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
anyio: 4.2.0
fastapi: 0.112.2
ffmpy: 0.4.0
gradio-client==1.3.0 is not installed.
huggingface-hub: 0.24.6
importlib-resources: 6.4.4
jinja2: 3.1.4
markupsafe: 2.1.3
matplotlib: 3.8.4
numpy: 1.26.4
orjson: 3.10.7
packaging: 23.2
pandas: 2.2.2
pillow: 10.3.0
pydantic: 2.5.3
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.6.3
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.5
typing-extensions: 4.11.0
urllib3: 2.2.2
uvicorn: 0.30.6
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2024.3.1
httpx: 0.27.0
huggingface-hub: 0.24.6
packaging: 23.2
typing-extensions: 4.11.0
websockets: 12.0

Severity

Blocking usage of gradio

freddyaboulton commented 2 months ago

Hi @oreoluwa212 - can you please pass in the --python-path argument? It should be the path to the python interpreter in the environment your component was installed in.