Forum Discussion
Notebook to load file from Lakehouse to SFTP failed
Hey Community, I need your help to troubleshooting below script:
Purpose: Upload file from Lakehouse to SFTP
Failure Message:
No such file or directory: 'Files/test.csv'
Script:
Looks I found the solution:
Hi zxbucks ,
You already found the right fix 👍 — the issue was just the file path. In Fabric notebooks, Files/test.csv is not a valid local path for Python libraries like paramiko. The file system that your code can see always starts at the Lakehouse mount point.
That’s why Paramiko couldn’t find the file and raised “No such file or directory”.
The correct way to reference a file from the Lakehouse is:
local_csv_path = "/lakehouse/default/Files/test.csv"
Once you use the full Lakehouse path, sftp.put() works as expected.
Your tip about using “Copy file API path” from the Lakehouse UI is perfect — that’s the easiest way to get the right path format without guessing.
So yes, your solution is 100% correct, and this is exactly how it should be done in Fabric.
– Gopi Krishna
1 Reply
- Ugk161610
Super User
Hi zxbucks ,
You already found the right fix 👍 — the issue was just the file path. In Fabric notebooks, Files/test.csv is not a valid local path for Python libraries like paramiko. The file system that your code can see always starts at the Lakehouse mount point.
That’s why Paramiko couldn’t find the file and raised “No such file or directory”.
The correct way to reference a file from the Lakehouse is:
local_csv_path = "/lakehouse/default/Files/test.csv"
Once you use the full Lakehouse path, sftp.put() works as expected.
Your tip about using “Copy file API path” from the Lakehouse UI is perfect — that’s the easiest way to get the right path format without guessing.
So yes, your solution is 100% correct, and this is exactly how it should be done in Fabric.
– Gopi Krishna