Error while following custom component tutorial.
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
Logs
No response
System Info
Windows 11
python 3.11
Nodejs : v18.14.2
npm : 9.5.1
Severity
Blocking usage of gradio
Hi @arcontechnologies are you using the latest version of gradio?
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.
Is this the case if you use a different component as a template as well?
Yes I tried with File (following tutorial recommendation) and got the same outcome.
I just tried with an other component; Same behavior
Hi @arcontechnologies - What version do you have for @gradio/preview in frontend/package.json?
here it is : "@gradio/preview": "0.10.2"
@freddyaboulton Hi, any news regarding this ? Let me know if I have to handle further tests or check something else.
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 .
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
Can you please try with the latest version of gradio? I think this issue has been fixed!