When I created my streamlit sharing app a few months ago I used streamlit version 0.76 and pandas version 1.2.4. I just included streamlit==0.76.0 in the requirements file because pandas is automatically included in streamlit.
Last week I noticed that my streamlit sharing app had an error with dataframe styling
(similar to this one: Strange error: unable to understand what it means - streamlit)
and I found out that the reason for it was an issue with the new pandas version 1.3.0 which was released on 2 July.
This issue has already been solved.
I repaired my streamlit sharing app by including pandas==1.2.4 in the requirements file, I also upgraded to the latest streamlit version 0.84.0.
But now I wonder if it would be better to also include all other library versions in my requirements file to avoid unexpected errors in future.
What is the recommendation?
As you may have guessed already, to be on the safe side you should pin the Pandas version for your app, as Streamlit downloads the most recent version higher than 0.21.0, which is not always what you want (I was bitten by this a while ago, Streamlit bumped my Pandas to 1.2.0 which would not read .xlsx files and broke my app)
It is best practice to pin your Streamlit version in requirements.txt . Otherwise, the version may be auto-upgraded at any point without your knowledge, which could lead to undesired results (e.g. when we deprecate a feature in Streamlit).
You can use tools like pip-tools or pipreqs to help you generate the set of versions that work with your application.
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.