blackary / st_pages

An experimental version of Streamlit Multi-Page Apps
MIT License
467 stars 77 forks source link

New Streamlit update today breaks st-pages #102

Closed Sprocketer closed 3 months ago

Sprocketer commented 3 months ago

Install and try - gets an error @blackary

sfc-gh-trichards commented 3 months ago

hey, what error do you get?

Sprocketer commented 3 months ago

@sfc-gh-trichards

Traceback (most recent call last):
  File "/usr/local/python/3.10.13/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 589, in _run_script
    exec(code, module.__dict__)
  File "/workspaces/BPhO-Computational/streamlit_app.py", line 18, in <module>
    show_pages_from_config()
  File "/usr/local/python/3.10.13/lib/python3.10/site-packages/streamlit/runtime/metrics_util.py", line 408, in wrapped_func
    result = non_optional_func(*args, **kwargs)
  File "/home/codespace/.local/lib/python3.10/site-packages/st_pages/__init__.py", line 308, in _show_pages_from_config
    show_pages(pages)
  File "/usr/local/python/3.10.13/lib/python3.10/site-packages/streamlit/runtime/metrics_util.py", line 408, in wrapped_func
    result = non_optional_func(*args, **kwargs)
  File "/home/codespace/.local/lib/python3.10/site-packages/st_pages/__init__.py", line 252, in _show_pages
    rt._sources_watcher = LocalSourcesWatcher(rt._main_script_path)
  File "/usr/local/python/3.10.13/lib/python3.10/site-packages/streamlit/watcher/local_sources_watcher.py", line 51, in __init__
    self._main_script_path = os.path.abspath(self._pages_manager.main_script_path)
AttributeError: 'str' object has no attribute 'main_script_path'
Sprocketer commented 3 months ago

Actually nevermind I just updated st-pages and it works fine again