Emoji not displaying when working locally without internet access

  1. Are you running your app locally or is it deployed?
    Locally, in a VM without internet access.
  2. If your app is deployed:
    Na
  3. Share the link to your app’s public GitHub repository (including a requirements file).
    Na
  4. Share the full text of the error message (not a screenshot).
    There is no error message
  5. Share the Streamlit and Python versions.
  • Python 3.9.2
  • Streamlit, version 1.37.1

My issue is that I am trying to add an emoji like this:

import streamlit as st

st.write(f":clock3: {time_since_last_prediction}")

However, I get no emoji but this:
image

I believe it is due to the fact that I have no access to the internet, but is there a workaround?

Try this instead:

st.write(f"🕒 {time_since_last_prediction}")

When I copy paste to VSC I get a square already in the py file. When I paste here, however, it’s Ok.

That is weird. I don’t have VSC but I can paste it in any other editor I tried (Windows Notepad, Gnome Text Editor, Geany and Jupyter).

Also your original code using ":clock3:" works for me on iron without Internet access, so Internet access doesn’t seem to be the issue.

You can always decode the raw bytes:

time_since_last_prediction = "4:01:30.288483"
clock3 = b'\xf0\x9f\x95\x92'.decode()
st.write(f"{clock3} {time_since_last_prediction}")