Unable to open file error (path issue)

Kim Larbey
  • 19 Jun '23

Hello, I am new to JupyterLab and Python and I was going over one of the tutorials. When going through the lines of code in the tutorial, "gas = il.snapshot.loadSubset(basePath, 99, 'gas', fields=['Masses','Coordinates'])", comes up with an "Unable to open file" error. I was just wondering what was going wrong and how I could fix that? I have attached a screen shot of the error message. JupyterLab Tutorial Error.png

Thank you

Dylan Nelson
  • 19 Jun '23

This is just a "path issue", you have a relative path (which is ok), but that means the snapshot files have to exist where the script is searching for them (as given by name), with respect to where this notebook is. Where is the notebook? If it is inside the "examples/" directory, then you need to add "../" to the beginning of basePath, or else copy the notebook out of the "examples/" directory into your home directory.

Or, use an absolute path (basePath = /home/tnguser/sims.TNG/... should work?)

  • Page 1 of 1