gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Error while following custom component tutorial.

Open arcontechnologies opened this issue 1 year ago • 10 comments

Describe the bug

following custom component tutorial, I started by creating the project : gradio cc create MyTextBox --template SimpleTextbox

then I tried run the next command : gradio cc dev where an error occurred :

Have you searched existing issues? 🔎

  • [X] I have searched and found no existing issues

Reproduction

demo code

Screenshot

image

image

Logs

No response

System Info

Windows 11
python 3.11
Nodejs : v18.14.2
npm : 9.5.1

Severity

Blocking usage of gradio

arcontechnologies avatar Aug 04 '24 19:08 arcontechnologies

Hi @arcontechnologies are you using the latest version of gradio?

abidlabs avatar Aug 05 '24 18:08 abidlabs

Hi @abidlabs Yes I'm using the last one : 4.40.0 I tried 4.39.0 and also 4.35.0 to see if any regression but I'm ending with same error. I also updated nodejs : v20.16.0 and npm : 10.8.2 and still facing the issue.

arcontechnologies avatar Aug 05 '24 18:08 arcontechnologies

Is this the case if you use a different component as a template as well?

abidlabs avatar Aug 05 '24 19:08 abidlabs

Yes I tried with File (following tutorial recommendation) and got the same outcome.

arcontechnologies avatar Aug 05 '24 19:08 arcontechnologies

I just tried with an other component; Same behavior image image

arcontechnologies avatar Aug 05 '24 19:08 arcontechnologies

Hi @arcontechnologies - What version do you have for @gradio/preview in frontend/package.json?

freddyaboulton avatar Aug 05 '24 19:08 freddyaboulton

here it is : "@gradio/preview": "0.10.2"

arcontechnologies avatar Aug 05 '24 19:08 arcontechnologies

@freddyaboulton Hi, any news regarding this ? Let me know if I have to handle further tests or check something else.

arcontechnologies avatar Aug 16 '24 12:08 arcontechnologies

I do not know if I had the same problem but ..... I was also following the basic tutorial and created a custom component from a fileExplorer component. It did not work out of the box running your steps above, even if I changed nothing ....... The problem is I am running linuxmint. What you will find is that there is a "requirements.txt" file in the demo folder. This means the component must be installed in python first. Usually you would do it as follows.... python install -e mycomponent, which means you can edit the python code and then it is automatically updated in your python installed folder. But this does not work here. What you have to do, (in my case) run "gradio cc install" first, which installs your component in the python library. Only then can the app.py find it and run it using "gradio cc dev". The developers must update the "create" scrypt or include this in the documentation .... This solved my problem. Hope it does yours. BTW I first created a conda environment to make sure everything is OK....

I tried it again and failed. Then I changed the PYTHONPATH as foilows and it worked again export PYTHONPATH=$PYTHONPATH:./backend gradio cc dev But first I did install it again using the following pip install -e .

PietFourie avatar Aug 26 '24 16:08 PietFourie

Got another error on linux during build. I got "permission" problems I had to install the following ...... sudo pip install trove-classifiers tomli pluggy pathspec packaging hatchling hatch-requirements-txt hatch-fancy-pypi-readme

PietFourie avatar Aug 26 '24 16:08 PietFourie

Can you please try with the latest version of gradio? I think this issue has been fixed!

freddyaboulton avatar Jun 10 '25 00:06 freddyaboulton