None of the two solutions works. When I host the app, the prompt is fine. But when I then try to access the app via either the network url or the local, it suddenly keeps spamming the messages in the picture below every millisecond and the app just says “Please Wait…” and blinks “Connecting…” in the upper right corner… Any hints?
Streamlit version: 0.69.2
From the error message, it seems like the issue is that it can’t find the file on the G:// drive. If you’re hosting this app somewhere other than the computer where you developed it, it’s unlikely that the same drive letter will be applicable.
It’s better if you can either give an exact directory path including the machine name, or using a relative reference to the file relative to where the Python code is running.
Right, but if Python is throwing an error, then it doesn’t really matter the drive letter.
To debug, can you comment out the section that contains the file reading portion and see if the app loads? If it does, then we can focus on fixing that error. Or, feel free to post a code snippet and I can try it myself.
I have found the issue but I have absolutely no idea why it is causing it…
When I comment out snippet 1, it works. Yet, snippet 2 is causing no problems…
Could it be due to the sheer size of the FastText-model (128MB)?
Note: I’ve tried with and without @st.cache(allow_output_mutation=True).
@st.cache(allow_output_mutation=True)
def load_pep():
data = pd.read_excel(r’file:///C:/Repos/Streamlit/Baggrundstjek/PEP_listen_updated 09102020.xlsx’)
data = data[data[‘Fornavn’].notna()]
return data
pep = load_pep()
What is even more odd is that everything works perfectly fine every single time if i do the following…
Step 1:
Run the streamlit x.py file.
Step 2:
go to the app (either through localhost or network url, doesn’t matter)
Step 3: Experiencing the " Symptom #2: The app says “Please wait…” forever" (https://docs.streamlit.io/en/0.62.0/troubleshooting/not-loading.html)
Step 3: Shut down the app in the anaconda prompt and start it again immediately while remaining on the app in the browser.
Step 4: The app instanly “gets connection” and loads and works perfectly fine…
However, this is not a solution since I can’t restart the app everytime someone tries to access it.
I am quite sure the problem is somehow related to when I load a file in the script, but why?
No, this (almost certainly) isn’t a Streamlit-related issue. Running chdir() seems like the wrong method to be using in an application. Can you specify the directory path explicitly, or at least make a relative reference to the file?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
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.
Performance cookies
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.
Functional cookies
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.
Targeting cookies
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.