Hello,
I encounter this error while running the Plotting Demo.
It gives the following, in case you cannot see the screenshot: StreamlitAPIException : ‘RangeIndex’ object has no attribute ‘step’
Hello,
I encounter this error while running the Plotting Demo.
It gives the following, in case you cannot see the screenshot: StreamlitAPIException : ‘RangeIndex’ object has no attribute ‘step’
Hi @tabsa, thanks for joining the community!
What version of Streamlit are you using, and what operating system?
I installed Streamlit 0.58 in a fresh Conda environment on Windows 10 and the plotting demo (and all the rest) worked with Microsoft Edge.
Did you install Streamlit in a fresh Python environment or globally? Also, which browser are you using?
I use google chrome and test in microsoft edge that gives another error.
I installed in a global Python environment that I normally use, didn’t create a fresh one just for streamlit.
Unfortunately, I think the global environment might be your answer then. The pip installer is pretty notorious for not solving environments correctly, so it could the case that one of your global packages is on a version of a dependency we don’t support.
Do you have a suppport gui about pip install in a virtual environment? Or maybe another way would be to update to the version required by streamlit the packages used in this demo. Unfortunately, I don’t know all the packages (and respectives version) used here, would be OK to provide this info?
I would definitely recommend getting used to using environments over trying to make your global environment conform by checking individual package versions. You could start here:
Thanks for the recommendation. I didn’t try yet the virtual environments to avoid the problems with the pip installer, but I realize one thing while I run the Plotting Demo in my OS.
import time
import numpy as npprogress_bar = st.sidebar.progress(0)
status_text = st.sidebar.empty()
last_rows = np.random.randn(1, 1)
chart = st.line_chart(last_rows)for i in range(1, 101):
new_rows = last_rows[-1, :] + np.random.randn(5, 1).cumsum(axis=0)
status_text.text(“%i%% Complete” % i)
chart.add_rows(new_rows)
progress_bar.progress(i)
last_rows = new_rows
time.sleep(0.05)progress_bar.empty()
From the code of the plotting demo, the command chart.addrows(newrows) is the troublemaker. When I replace it for chart.line_chart(newrows), the demo runs but without stacking the newrows in the same line_chart. Is there any explanation for this?
Given that it runs in a clean environment for me on Windows, I really think you need to try the virtual environment. It’s hard to point at that line of code as the error when we can’t reproduce the issue.
Just to let know, I was able to run the Plotting Demo using the virtual environment as suggested. Thanks a lot for the support!
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.