[BUG] ImportError: cannot import name 'make_url_path_regex' from 'streamlit.web.server.server_util'
Describe the bug When running a Streamlit app using Python 3.13, an ImportError occurs immediately upon startup because pygwalker tries to import a utility function ('make_url_path_regex') that has been removed or modified in newer versions of Streamlit. To Reproduce Steps to reproduce the behavior:
- Set up a project with Python 3.13 and a recent version of Streamlit.
- Import pygwalker for Streamlit (e.g., from pygwalker.api.streamlit import StreamlitRenderer).
- Run the application via terminal using 'streamlit run app.py'.
- See error: ImportError: cannot import name 'make_url_path_regex' from 'streamlit.web.server.server_util'
Expected behavior The Streamlit application should start and initialize the PyGWalker renderer without throwing an import error.
Versions
- pygwalker version: [Run 'pip show pygwalker' and paste it here]
- python version: 3.13
- browser: [e.g., Chrome, Edge, Firefox]
Additional context Full error trace location from local environment: ImportError: cannot import name 'make_url_path_regex' from 'streamlit.web.server.server_util' (C:\Users\MMC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\streamlit\web\server\server_util.py) Streamlit version being used: Streamlit, version 1.63.0
Full error: ImportError: cannot import name 'make_url_path_regex' from 'streamlit.web.server.server_util' (C:\Users\MMC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\streamlit\web\server\server_util.py)
File "c:\Users\MMC\Desktop\Financial Modelling\main.py", line 16, in page.run() ~~~~~~~~^^ File "C:\Users\MMC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\streamlit\navigation\page.py", line 494, in run exec(code, module.dict) # noqa: S102 ~~~~^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\MMC\Desktop\Financial Modelling\app_pages\pygwalker_page.py", line 1, in from pygwalker.api.streamlit import StreamlitRenderer File "C:\Users\MMC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pygwalker\api\streamlit.py", line 12, in from pygwalker.communications.streamlit_comm import ( ...<3 lines>... ) File "C:\Users\MMC\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.13_qbz5n2kfra8p0\LocalCache\local-packages\Python313\site-packages\pygwalker\communications\streamlit_comm.py", line 6, in from streamlit.web.server.server_util import make_url_path_regex
Source: Kanaries/pygwalker