0

I'm working with large netcdf files (3D gridded atmospheric data) that live on a server in my department. And I'm having trouble importing them. I try something like this:

from netCDF4 import Dataset
filename = 'nfs://path-to-file/file.nc'
file = Dataset(filename)

This has worked perfectly fine for files stored within my root directory, but because the server exists behind/outside of my root, I get an error when I try to import the files into a jupyterlab notebook:

FileNotFoundError: [Errno 2] No such file or directory: b'nfs://path-to-file/file.nc'

But I copied the absolute path from finder (Mac OS) so I'm sure that it's there.

I've tried telling python to look in the server using

import sys
sys.path.insert(0, 'nfs://server-name/path-to-file/')

But that hasn't worked and gives the same error as above. Will I need to change something else using python's sys or os packages? The files are large so I don't want to copy them to my local machine.

mneedham
  • 45
  • 4
  • Possible duplicate of [Importing files from different folder](https://stackoverflow.com/questions/4383571/importing-files-from-different-folder) – pypalms May 31 '19 at 18:32
  • df -H (what does it say?) – dejanmarich May 31 '19 at 18:58
  • Possible duplicate of [Using Python, how can I access a shared folder on windows network?](https://stackoverflow.com/questions/7169845/using-python-how-can-i-access-a-shared-folder-on-windows-network) – wwii May 31 '19 at 19:19

0 Answers0