cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

FileNotFoundError: [Errno 2] No such file or directory: '/FileStore/tables/flight_data.zip' The data and file exists in location mentioned above

Data_Engineer_3
New Contributor III

I am new to learning Spark and working on some practice; I have uploaded a zip file in DBFS /FileStore/tables directory and trying to run a python code to unzip the file; The python code is as: 

from zipfile import *

with ZipFile("/FileStore/tables/flight_data.zip", "r") as zipObj:

zipObj.extractall()

It throws an error:

FileNotFoundError: [Errno 2] No such file or directory: '/FileStore/tables/flight_data.zip'

When i check manually and also through the code dbutils.fs.ls("/FileStore/tables/") it returns

Out[13]: [ FileInfo(path='dbfs:/FileStore/tables/flight_data.zip', name='flight_data.zip', size=59082358)]

Can someone please review and advise; I am using community edition to run this on cluster with configuration:

Data Bricks Runtime Version 8.3 (includes Apache Spark 3.1.1, Scala 2.12)

17 REPLIES 17

I changed the Databricks runtime​ version in cluster and it worked in my case. Thank you @Kaniz Fatma​ 

Hi @Mahima Lalwani​ , That's awesome. Would you like to mark it as the best answer?

883022
New Contributor II

What if changing the runtime is not an option? I'm experiencing a similar issue using the following:

%pip install -r /dbfs/path/to/file.txt

This worked for a while, but now I'm getting the Errno 2 mentioned above. I am still able to print the same file using dbutils.fs.head('dbfs:/path/to/file.txt')

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.