Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save file locally in jupyterhub notebook running on EMR cluster

When using Jupyterhub application interface (via SSH tunneling) on Amazon EMR, the default file explorer says /user/jovyan/tree. What directory is this and how can I save a file (say a matplotlib figure) from within the notebook to this local space? The usual tricks like

os.chdir(sys.path[0])
print(os.getcwd())

show /mnt/tmp, which does not actually appear to be the local directory.

like image 849
qwr Avatar asked Jan 29 '26 11:01

qwr


1 Answers

The code that you are running in EMR notebook is actually saved on s3. By default, it is often in a bucket named something like emr-resources, under the notebooks folder.

Try checking your s3 and I believe if you save a file from within an emr notebook, it will be available save in s3 (and available next time)

like image 140
A.B Avatar answered Jan 30 '26 23:01

A.B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!