srush / streambook

Live Python Notebooks with any Editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compatibility with the latest version of streamlit

niyue opened this issue · comments

commented

I followed the instructions to do:

pip install streambook
streambook run experiment.py

Errors like below are reported:

❯ streambook run experiment.py
Traceback (most recent call last):
  File "/Users/ss/.pyenv/versions/3.9.0/bin/streambook", line 5, in <module>
    from streambook.cli import app
  File "/Users/ss/.pyenv/versions/3.9.0/lib/python3.9/site-packages/streambook/__init__.py", line 1, in <module>
    from .lib import *  # noqa: F401,F403
  File "/Users/ss/.pyenv/versions/3.9.0/lib/python3.9/site-packages/streambook/lib.py", line 4, in <module>
    from streamlit.report_thread import REPORT_CONTEXT_ATTR_NAME
ModuleNotFoundError: No module named 'streamlit.report_thread'

It seems there is some API compatibility issue when streamlit was upgraded to 1.4 [1] [2]. And streambook's latest release was half year ago, is it still compatible with the latest version of streamlit? Thanks.

[1] https://discuss.streamlit.io/t/modulenotfounderror-no-module-named-streamlit-report-thread/20983
[2] https://stackoverflow.com/questions/70813915/error-importing-hydralit-modulenotfounderror-no-module-named-streamlit-repor

commented

BTW, I did try downgrading streamlit to 1.3.0 and the above error was gone. However, another API error was reported like below:

❯ poetry run streambook run experiment.py
Traceback (most recent call last):
  File "/Users/ss/Library/Caches/pypoetry/virtualenvs/swdiag-ltoZR4nH-py3.9/bin/streambook", line 5, in <module>
    from streambook.cli import app
  File "/Users/ss/Library/Caches/pypoetry/virtualenvs/swdiag-ltoZR4nH-py3.9/lib/python3.9/site-packages/streambook/__init__.py", line 2, in <module>
    from .gen import *  # noqa: F401,F403
  File "/Users/ss/Library/Caches/pypoetry/virtualenvs/swdiag-ltoZR4nH-py3.9/lib/python3.9/site-packages/streambook/gen.py", line 8, in <module>
    class Collect(mistune.Renderer):
AttributeError: module 'mistune' has no attribute 'Renderer'

Seems like versioning issues. I'll fix today.

Should be fixed now.