[Local Development] Streamlit not fetching python changes

Hi -

I am trying to bring up Streamlit locally and add a get_url method so I can call st.get_url() to fetch the current URL from the user’s browser.

I have followed the set up in the contributing guide, however my backend python changes are not reflected, only frontend is!

Here is what I did to test that my python changes are reflected locally…

  1. Run yarn start at streamlit/frontend
  2. Made changes to __init__.py at streamlit/lib/streamlit (like change spinner default text here )
  3. Added a new file called test.py at streamlit/lib containing below
import streamlit as st
import time

with st.spinner():
  1. Run streamlit run test.py at streamlit/lib. The spinner text is not updated to reflect my local changes at http://localhost:3000 ! :pensive:

I think streamlit is still pointing my local binary instead of fetching my local changes, how do I fix this?

Thanks in advance!
A Random Streamlit Fan

Hi Random Streamlit Fan :slight_smile:

If your which streamlit is pointing to your local binary instead of the Pipenv dev environment, maybe your environment is not active ? Did you run :

cd lib
pipenv shell

before streamlit run test.py ? I usually run which streamlit to ensure I’m in the correct environment

Hi @andfanilo

Thanks for replying! Yes I did run pipenv shell before.
However my which streamlit always shows the /Users/zhaoooyue/opt/anaconda3/bin/streamlit, which is not my local streamlit path. Any idea how to change this?


Hmmm, I’m more of a Windows guy than a Unix guy, and more of a Conda user than Pipenv user :sweat_smile: anyway, perhaps in your PATH environment variable, even after you use pipenv shell the path to your local Streamlit is the first one to appear ?
If your pipenv path is the first one in PATH then perhaps Streamlit is actually not installed and you should rerun make all-devel in your environment.

Good luck !

Thanks for your help! It’s due to a clash with anaconda - works fine after I uninstalled anaconda :rofl:

1 Like

Ahah glad you found the clash though it meant the removal of Anaconda :sweat_smile:

I’m surprised, I’m working in a Unix VM with pipenv installed on my Miniconda and I don’t get your problem…oh well as long as it works :upside_down_face:

1 Like