Error while reading file from managed folder in webapp
Hi
I am trying to read a csv file from a managed folder in dash webapp using the following code:
models = dataiku.Folder("LFHBynG2")
folder_path = models.get_path()
df_clearstate = pd.read_excel((os.path.join(folder_path,'Clearstate Data 2008-2020@20211019.xlsx')), sheet_name='Sheet2')
But getting the following error:
APIErrorException: [Errno 2] No such file or directory: '/data/dataiku/dss_data/managed_folders/MARKET_TRACKER/LFHBynG2/Clearstate Data 2008-2020@20211019.xlsx'
But if I'm trying to do the same thing in notebook, it is working. I'm sure that the file path is correct. I'm not able to understand why this is not working in webapp?
I want to read file from managed folder only since later I have to read some json files and text files for my application.
Thanks
Answers
-
tgb417 Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Frontrunner 2022 Finalist, Frontrunner 2022 Winner, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant, Neuron 2023 Posts: 1,598 Neuron
Welcome to the Dataiku Community.
In briefly reading your post here. I find it unusual to use an "at symbol" @ in a filename. Can you try your setup again with a different file name to see if things will work for you.
Just a thought. Others do you have a thought for @nakul_aggarwal
?--Tom
-
Thanks Tom for your response. I have tried the same with a simple file name as well like demo.txt but getting the same error response:
APIErrorException: [Errno 2] No such file or directory: '/data/dataiku/dss_data/managed_folders/MARKET_TRACKER/LFHBynG2/demo.txt'
Thanks
-
tgb417 Dataiku DSS Core Designer, Dataiku DSS & SQL, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Neuron 2020, Neuron, Registered, Dataiku Frontrunner Awards 2021 Finalist, Neuron 2021, Neuron 2022, Frontrunner 2022 Finalist, Frontrunner 2022 Winner, Dataiku Frontrunner Awards 2021 Participant, Frontrunner 2022 Participant, Neuron 2023 Posts: 1,598 Neuron
Got it! So I'm now wondering three things about your situation.
- Is you file on the local file system? I’m guessing yes.
- Is '/data/dataiku/dss_data/managed_folders/MARKET_TRACKER/LFHBynG2/Clearstate Data 2008-2020@20211019.xlsx'
the full path to your file? To test you might try.
- From the terminal can you
cd /data/dataiku/dss_data/managed_folders/MARKET_TRACKER/LFHBynG2 - Can you then ls Clearstate Data 2008-2020@20211019.xlsx and then see the file.
- From the terminal can you
- Does the account that the Dataiku Server is running as have access to this directory and file? In my case I do know the account that Dataiku is running under and I have root access. So, I sudo su into that account and the try checking out the file above.
Just a couple of thoughts. Hope they are helpful.