I’m new to streamlit and I’m trying to run a web app using it. My problem is:
FileNotFoundError: [Errno 2] No such file or directory: ‘data/DadosCopaDoMundoQatar2022.xlsx’
but this file exists! I already searched the forum for this problem, and found that the solution was to include in requirements.txt the openpyxl, but that I already did, and the problem persists. I also tried different paths to the file, but unsuccessful. My code is just
import streamlit as st from sklearn.preprocessing import MinMaxScaler import pandas as pd import numpy as np from scipy.stats import poisson st.title('FIFA World Cup Qatar 2022™ A.I.') teams = pd.read_excel('data/DadosCopaDoMundoQatar2022.xlsx', sheet_name ='selecoes', names = ['Teams_BR', 'Group', 'GroupNumber', 'Team', 'FIFAsRankPosition', 'MarketValue', 'FIFAsRankingPoints', 'Confederation', 'WorldCups', 'SpotlightPlayer', 'PictureOfPlayer', 'FlagsLinkSmall', 'FlagsLinksBig'], index_col = 0)
streamlit==1.14.0 pandas==1.5.1 numpy==1.23.0 scipy==1.9.3 openpyxl==3.0.7 #or 3.0.10 (error occurs for both) scikit-learn
All the files are in my GitHub: Data-Science-projects/project_6 at master · SirTales/Data-Science-projects · GitHub
The data to be read is in ‘project_6/data/’, and in my experience there should be no error there.
I already tried:
and even moving the .xlsx to the same folder of web_app.py (streamlit deploy) such as
pd.read_excel(‘DadosCopaDoMundoQatar2022.xlsx’) but all failed.
Thanks, in advance, for your help. And if anything else is necessary, just ask for, please!
- Streamlit version: 1.15.2
- Python version: 3.9.7
- Ubuntu 22
- Link to your GitHub repo: Data-Science-projects/project_6 at master · SirTales/Data-Science-projects · GitHub
- Link to deployed app: https://sirtales-data-science-projects-project-6web-app-ovvd8c.streamlit.app