Summary
Hey all!
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)
requirements.txt:
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:
pd.read_excel('https://github.com/SirTales/Data-Science-projects/tree/master/project_6/data/DadosCopaDoMundoQatar2022.xlsx')
pd.read_excel('Data-Science-projects/tree/master/project_6/data/DadosCopaDoMundoQatar2022.xlsx')
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!
Some infos:
- Streamlit version: 1.15.2
- Python version: 3.9.7
- Ubuntu 22
Links
- 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