Hello! I’ve written a .py script to scrape basketball statistics and display a dataframe. Name of the .py file is ucsb_streamlit.py, and it runs fine locally when I run:
streamlit run ucsb_streamlit.py
The dataframe shows up perfectly on the webpage. However when I deploy the app, I get hit with the traceback(s) in the attached photo.
It seems to be pointing to the following simple line of the code:
df = pd.read_html(url)
Why would that cause a traceback? Also in re: to the last bit of the error, I have verified that I already have lxml installed on my machine by running
pip install lxml
I get back “Requirement already satisfied…” Any help is much appreciated, thank you!
I learned about the requirements.txt necessity. So I added that for the few things I’m using:
lxml==4.6.3
pandas==1.3.4
streamlit==1.8.1
But now I get a long error running the app. From googling around, seems a lot of folks are having this problem. I can’t understand what I need to do. Thanks to anyone who can help! (error msg is attached in photo)
Take a look at the dependencies of the packages you are utilizing, maybe try to let the requirements free rather than stating the version, and go in order streamlit, pandas and then lxml. If possible, please share the repo.
Glad you got it sorted out! I suspect that the ordering might have been luck; if you set streamlit >= 1.9.2, it will fix it for certain (irrespective of the order)
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.