Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'streamlit' has no attribute '_DeltaGenerator' #8

Closed
maqiuping59 opened this issue Apr 15, 2024 · 6 comments
Closed

Comments

@maqiuping59
Copy link

maqiuping59 commented Apr 15, 2024

2024-04-15 19:09:16.492 Uncaught app exception
Traceback (most recent call last):
  File "D:\Anaconda3\envs\streamlit-learn\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 584, in _run_script
    exec(code, module.__dict__)
  File "D:\code\streamlit-learn\main.py", line 2, in <module>
    from streamlit_chatbox import *
  File "D:\Anaconda3\envs\streamlit-learn\Lib\site-packages\streamlit_chatbox\__init__.py", line 4, in <module>
    from .messages import *
  File "D:\Anaconda3\envs\streamlit-learn\Lib\site-packages\streamlit_chatbox\messages.py", line 1, in <module>
    from streamlit_chatbox.elements import *
  File "D:\Anaconda3\envs\streamlit-learn\Lib\site-packages\streamlit_chatbox\elements.py", line 6, in <module>
    class Element:
  File "D:\Anaconda3\envs\streamlit-learn\Lib\site-packages\streamlit_chatbox\elements.py", line 43, in Element
    def __call__(self, render_to: st._DeltaGenerator=None) -> st._DeltaGenerator:
                                  ^^^^^^^^^^^^^^^^^^
AttributeError: module 'streamlit' has no attribute '_DeltaGenerator'

when i run example.py, I met this error

@liunux4odoo
Copy link
Owner

what is the version of your streamlit?

@maqiuping59
Copy link
Author

streamlit version:1.33.0
streamlit-chatbox version:1.1.11

@liunux4odoo
Copy link
Owner

liunux4odoo commented Apr 16, 2024

it seems _DeltaGenerator attribute has been removed in streamlit 1.33.0.
you can try to downgrade streamlit.

@maqiuping59
Copy link
Author

I have solved this error using your way,thanks

@Dangd967
Copy link

which version did you use?
I got the same error, and cant fix it no matter what version i use

@liunux4odoo
Copy link
Owner

I plan to release version 1.1.12 next week which will solve this problem.

liunux4odoo added a commit that referenced this issue Apr 22, 2024
- add ChatBox.change_chat_name to rename a chat conversation
- maintain a context bound to chat conversation, it is like to be a sub session_state for every chat, context will get changed when you switch chat names.
      - user can save chat bound values by `ChatBox.context['x'] = 1`
      - values of widgets specified with a key can be saved to chat context with `ChatBox.context_from_session` and restored to st.session_state by `ChatBox.context_to_session`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants