Giter Site home page Giter Site logo

Comments (8)

raethlein avatar raethlein commented on May 19, 2024 5

Hey y'all, just a quick update that we are going to discuss the issue & potential fix (#8610) tomorrow and I'll keep you posted. Sorry for the inconvenience and thanks for reporting the issue with these details ❤️

from streamlit.

raethlein avatar raethlein commented on May 19, 2024 3

We have merged #8620 that should fix this issue, so it should land in streamlit-nightly and latest in 1.35 🙂

from streamlit.

raethlein avatar raethlein commented on May 19, 2024 2

Acknowledged! This behavior change seems to have been introduced via this PR, since now the Component Registry is loaded from the runtime and is not a singleton anymore. When you run the standalone command, the runtime does not seem to be initialized, resulting in the error you are seeing.
I will talk with the team and get back to you with regards to this. I am wondering whether there is a good way to solve this without invoking Streamlit under the hood at all in order to just print the version of the python package.

from streamlit.

kaizen63 avatar kaizen63 commented on May 19, 2024 1

Hello,
this is the same issue I raised here: NathanChen198/streamlit-rsa-auth-ui#1
Worked in 1.33 but in 1.34 its broken. Raises a RunTimeError too.

from streamlit.

FloTeu avatar FloTeu commented on May 19, 2024 1

I can confirm the same issue as well for the import of custom components.

Reproducable code:
Expects custom component streamlit_elements is installed

file: streamlit_bug_report.py

import streamlit as st
# This line raises "RuntimeError: Runtime hasn't been created!" in streamlit>=1.34.0
from streamlit_elements import elements, dashboard, mui, nivo

def app():
    # assume somthing with the streamlit_elements component happens here
    st.write("Hello World")


if __name__ == "__main__":
    app()

runs fine if one starts the app with streamlit run streamlit_bug_report.py

But if the app is started via cli with help of streamlit.web.bootstrap its now raising an error since streamlit version 1.34.0.

file: streamlit_bug_report_cli.py

import streamlit as st
import streamlit.web.bootstrap as st_bootstrap
from streamlit_bug_report import app

def main():
    if st.runtime.exists():
        # The app has been executed with `streamlit run app.py`
        app()
    else:
        # If the file has been executed with python (`python app.py`), the streamlit functionality
        # won't work. This line reruns the app within the streamlit context, as if it has been
        # executed with `streamlit run app.py`.
        # This is necessary when installing this project from a .whl package, since the executable
        # only gets execute by python and not by streamlit.
        st_bootstrap.run(
            __file__,
            is_hello=False,
            args=[],
            flag_options={},
        )


if __name__ == "__main__":
    main()

Running python streamlit_bug_report_cli.py will raise RuntimeError: Runtime hasn't been created!

from streamlit.

hansthen avatar hansthen commented on May 19, 2024 1

The issue also affects automated tests in packages like streamlit-folium, where custom components are tested without actually running Streamlit.

from streamlit.

gabrieltempass avatar gabrieltempass commented on May 19, 2024 1

Awesome, thanks!

from streamlit.

github-actions avatar github-actions commented on May 19, 2024

If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.

Your feedback helps us prioritize which bugs to investigate and address first.

Visits

from streamlit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.