Hi,
Sorry for the late reply. What you can do is open the file in the top of your Streamlit app and perform that fix with a .replace. The way I found the path was to first have a very small app with the `streamlit-aggrid` package installed.
Then you can have as the only piece of code
import st_aggrid
st.write(st_aggrid.__file__)
which will show that the path is `/lib/python3.12/site-packages/st_aggrid/init.py`.
We will use this to know where to find the file, but we have to patch it before we import it, so take a note of that path and replace the code with
with open('/lib/python3.12/site-packages/st_aggrid/__init__.py') as f:
contents = f.read()
contents = contents.replace('components.components.MarshallComponentException', 'components.custom_component.MarshallComponentException')
with open('/lib/python3.12/site-packages/st_aggrid/__init__.py', 'w') as f:
f.write(contents)
This will first read the file (see GitHub solution), then replace every occurrence with the wrong line with the correct one and then write the file. Now you can safely import it after.
with open('/lib/python3.12/site-packages/st_aggrid/__init__.py') as f:
contents = f.read()
contents = contents.replace('components.components.MarshallComponentException', 'components.custom_component.MarshallComponentException')
with open('/lib/python3.12/site-packages/st_aggrid/__init__.py', 'w') as f:
f.write(contents)
import st_aggrid
You may have to refresh the page between the first step (extracting the path) and the second since we cannot have imported the code before patching.
Let me know if this works or if it doesn’t!