Print not works with steamlit on debian system

Hi All,

i deployed a simple demo streamlit code on debian system
using pip installed streamlit 1.29.0

systeminfo as below:

PRETTY_NAME=“Debian GNU/Linux 10 (buster)”
NAME=“Debian GNU/Linux”
VERSION_ID=“10”
VERSION=“10 (buster)”
VERSION_CODENAME=buster
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“Debian -- User Support
BUG_REPORT_URL=“https://bugs.debian.org/

and my demo code is xxx.py

import streamlit as st

st.title("helo st")

print("test console")

when i start to run streamlit app with “streamlit run xxx.py”, the expected result is that “test console” will showed up in the startup console
but it didn’t works

the same code was tested on windows and it worked well

refer the snapshot

expected result is

so can someone help me out for this ?

Try using the os library instead:

Thx @mathcastsand for the quick reply

i tried the demo code for os.write for write for sd.out,
it didn’t work either

Streamlit primarily relies on the st.write function to display content rather than the standard Python print function

thanks for the relpy @Atharva_Sawant

in fact not only the print ,but there are some other kind of code didn’t work well on debian(linux), but the same code worked well on windows

i’m still looking forward if there is some tips to handle this? :laughing:

Yes, @yugen_liao, you got this…ensure consistency in the environment, dependencies, and Python versions

finally i got the reason why i didn’t see the print
actually the streamlit code works well on linux

key reason is that i need to understand the lifecycle of the streamlit begins with the page load
i didn’t see the print in my demo was that i didn’t trigger the page load.

now it works and it should be always works :slight_smile:

thanks all for the reply! hope u all have a good new year! :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.