Alignment is different in local version and cloud version

Hello Streamlit!

First of all, amazing work on this package, it is great!

However, one small issue that i am facing is alignment issues when i deploy my app online with streamlit share cloud.

The following screenshots use the same code, but as is visible, the cloud version (bottom screenshot) stops nicely aligning my table in the middle.


The code used is the folowing:

col1, col2, col3 = st.columns([1,2.5,1])

with col2:
    st.table(pd.DataFrame({
            'Time': ['21-12-21 10:00:00', '21-12-21 10:00:01','21-12-21 10:00:02','21-12-21 10:00:03'],
            'Sensor1': [10, 10, 11, 10],
            'Sensor2': [14,15,14,14]
        }).style.applymap(color_column, subset=['Time']))

How could i fix this?

2 Likes

Hi @stefanbloemheuvel, welcome to the Streamlit community!

The first thing I would check is that the version of Streamlit, pandas and Python are the same between your local environment and Streamlit Cloud. Do you have a requirements file in your repo?

Best,
Randy

How could i make sure that streamlit uses a certain python version? Is that also possible with a requirements.txt file?

You can set the Python version in the Advanced Settings menu:

Best,
Randy

ah thanks i had to first delete and then redeploy to find that setting but it worked! Thanks for the help @randyzwitch i really appreciate it!

1 Like

Yes, sorry for not being clear the delete-and-relaunch is installed. We have a feature request internally to move that into the normal configuration settings so that it’s in the same place as the secrets and just a drop-down to flip on a launched app.