AttributeError: 'NoneType' object has no attribute 'group'

Sometimes, this problem appears:

AttributeError: ‘NoneType’ object has no attribute ‘group’ or

TypeError: ‘NoneType’ object is not iterable

Sometimes its OK, in

https://share.streamlit.io/luiscarloseiras/gpt-2pt/main/gpt-2.py

Hey @LuisCarlosEiras,

First off welcome to the Streamlit Community! :tada: :tada: :tada: :tada: :tada: :tada: :partying_face:

To help you with your question:
This warning is coming up because when you call the st.text_area('some text') with only one parameter (the ‘some text’ part) passes an empty string to your translator which is giving you the AttributeError you see.

To make this work as is: you simply need to add some default text to render in the text area so that the string you pass to the translator is not empty.

text_unlim = st.text_area("Area for text", "Text to Display")

This gives:

Happy Streamlit-ing!
Marisa

1 Like

Thanks, Marisa. I loved it! I will try until today.

I just have two streamlit:

https://share.streamlit.io/luiscarloseiras/queneau/main/queneau.py

https://share.streamlit.io/luiscarloseiras/quantossites/main/Quantossites.py

Luís Carlos

Hi, Marisa,

I made the changes, but it’s still unstable, sometimes it works OK, sometimes it doesn’t.
I would like to know if there would be a solution for when the error appeared, there would be a new processing without the user knowing.

Thanks,

Luis Carlos

An example:

I fixed it with google-trans-new==1.1.9.

2 Likes