For me reinstalling streamlit in the virtual environment solved the issue. Make sure you are in ure virtual env. Then use
pip uninstall streamlit
and confirm if prompted. Then install again with
pip install streamlit
Let me now if this helped.