Excel Directory Arragement Before Deployment

Good Morning My beloved companions at Plotly Dash Community :slight_smile:
I wish you are all doing well
in my recent apps i tend to use CSV files , however this time I am using excel file but the Deployment consistently failed even though I have attempted all the possible ways to provide the correct path and directory to my excel file , I really appreciate your assistance and your effort to make plotly community a learning organisation , please help me resolve this issue as I am just a beginner in this field
this is link to my Git hub repository where my project resides:

this the error message I received
With Kind regards @hoatran @jinnyzor @adamschroeder @hoatran


image

Usually the external files are placed in the assets folder.

I also would guess, that path operations won’t work when trying to deploy.

Try hard coding something like assets/yourfile

1 Like

Hi @AIMPED
The file is placed in a folder called Data
You can access it in my GitHub repository above
Any way thanks for your proposal
With best regards

1 Like

Hello @Bahageel88,

Assuming you are running the app.py from the same location, you should be able to just reference it via, ./data.

1 Like

Yes I tried this as well but it did not work brother

@Bahageel88
Sometimes when reading excel sheets into the app with pandas, I need to install this library openpyxl: pip install openpyxl

I hope this helps,
p.s. Can you please try to avoid tagging people on initial posts. When you target certain people, it reduces the likelihood of other community members helping you.

1 Like

Hi Adam
I already installed openpyxl and the application worked in my local machine, this problem occurred after I tried to deploy the app so what do you recommend me to do ?
Ok I will make the first post general without tagging people, I apologize I did not mean to exclude others from participating
With best regards

@Bahageel88: Based on Adam and jinnyzor suggestion I think you should do something as below:

  • First: Revise your code from ..main/data to ./data
PATH = pathlib.Path(__file__).parent
DATA_PATH = PATH.joinpath("./data").resolve()
  • Second: In your requirement.txt, you should change from just openpyxl to openpyxl==3.1.0

Hope this help.

1 Like

@hoatran
thank you very much indeed I have made these modifications , however it raised an error even though the app works perfectly on my local machine : this is error message I got


link to file : Art_Of-_Data_Visualization_Project_two/app.py at main Β· Datascientist88/Art_Of-_Data_Visualization_Project_two Β· GitHub
why I have no clue
any way thank you
with best regards

@Bahageel88: You forgot ) in pd.read_excel

1 Like

@hoatran hoatran
Tell me how can I thank you ? perfect solutions always provided by you , your proposal worked perfectly well
thank you very much indeed and to all my beloved companions at plotly community , I will keep on learning from you all guys , you have a noble spirit dedicated to educating others for free , really thank you all
with best regards
https://data-visualization-unemployment-dashboard.onrender.com/

1 Like

I’m also learner of Dash like you and I am still inexperienced, helping people also helps me gain more knowledge. I’m glad I was able to help you

2 Likes