Skip to content

[BUG] ImportError: cannot import name 'make_url_path_regex' from 'streamlit.web.server.server_util' #743

Description

@MrJoJI110

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:

  1. Set up a project with Python 3.13 and a recent version of Streamlit.
  2. Import pygwalker for Streamlit (e.g., from pygwalker.api.streamlit import StreamlitRenderer).
  3. Run the application via terminal using 'streamlit run app.py'.
  4. 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.

Image

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions