[Mne_analysis] how to use tutorials when mne is not installed in home directory?

Dan McCloy dan at mccloy.info
Fri Sep 11 10:52:04 EDT 2020
Search archives:

        External Email - Use Caution        

Adding to what Alex said, you can configure globally where you want datasets to be stored (and where MNE-Python will look for them when loading the datasets) using the MNE_DATA config variable. For example:

mne.set_config('MNE_DATA', '/opt/data')

will cause datasets to be downloaded to /opt/data/MNE-sample-data, /opt/data/MNE-fnirs-motor-data, etc.

-- dan
Daniel McCloy
https://dan.mccloy.info
Research Scientist
Institute for Learning and Brain Sciences
University of Washington

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Friday, September 11, 2020 2:12 AM, Alexandre Gramfort <alexandre.gramfort at inria.fr> wrote:

> External Email - Use Caution
>
> hi Megan,
>
> you can install mne anywhere you like but when it downloads
> data it tries to put them in your home directory by default.
>
> see doc: https://mne.tools/stable/generated/mne.datasets.sample.data_path.html
>
> you can specify what path you want.
>
> HTH
> Alex
>
> On Thu, Sep 10, 2020 at 11:32 PM Megan Schendel mschendel at mrn.org wrote:
>
> >         External Email - Use Caution
> >
> >
> > Hi all,
> > Still working on my upgrade issue, but in the meantime, I have a question about the sample data.
> > I'm trying the tutorial for source timec ourse visualization...
> > https://mne.tools/stable/auto_tutorials/source-modeling/plot_visualize_stc.html#sphx-glr-auto-tutorials-source-modeling-plot-visualize-stc-py
> > ... but when I try
> > data_path = sample.data_path()
> > I get an error. It looks to me like it's looking for sample in my user home directory, but I have mne installed in a shared directory. If I understood better what the sample path should be, I could just create the data path string. Or perhaps I don't have the sample data at all because of the discrepancy between mne path and sample path?
> > Thanks for your help, see the error below.
> > Megan
> >
> > data_path = sample.data_path()
> > Downloading archive MNE-sample-data-processed.tar.gz to /na/homes/mschendel/mne_data
> > Downloading https://files.osf.io/v1/resources/rxvq7/providers/osfstorage/59c0e26f9ad5a1025c4ab159?version=5&action=download&direct (1.54 GB)
> > Error while fetching file https://osf.io/86qa2/download?version=5. Dataset fetching aborted. ?B/s]
> >
> > --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> >
> > FileNotFoundError Traceback (most recent call last)
> > <ipython-input-6-a3504eb0c729> in <module>
> > ----> 1 data_path = sample.data_path()
> > <decorator-gen-407> in data_path(path, force_update, update_path, download, verbose)
> > /export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne20/lib/python3.8/site-packages/mne/datasets/sample/sample.py in data_path(path, force_update, update_path, download, verbose)
> > 17 def data_path(path=None, force_update=False, update_path=True, download=True,
> > 18 verbose=None): # noqa: D103
> > ---> 19 return _data_path(path=path, force_update=force_update,
> > 20 update_path=update_path, name='sample',
> > 21 download=download)
> > /export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne20/lib/python3.8/site-packages/mne/datasets/utils.py in data_path(path, force_update, update_path, download, name, check_version, return_version, archive_name)
> > 393 full_name = list()
> > 394 for u, an, h, fo in zip(url, archive_name, hash, folder_orig):--> 395 remove_archive, full = _download(path, u, an, h)
> > 396 full_name.append(full)
> > 397 del archive_name
> > /export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne20/lib/python3.8/site-packages/mne/datasets/utils.py in download(path, url, archive_name, hash, hash_type)
> > 450 if fetch_archive:
> > 451 logger.info('Downloading archive %s to %s' % (archive_name, path))
> > --> 452 fetch_file(url, full_name, print_destination=False,
> > 453 hash=hash_, hash_type=hash_type)454 return remove_archive, full_name
> > <decorator-gen-3> in fetch_file(url, file_name, print_destination, resume, hash, timeout, hash_type, verbose)
> > /export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne20/lib/python3.8/site-packages/mne/utils/fetching.py in fetch_file(url, file_name, print_destination, resume, hash, timeout, hash_type, verbose)
> > 115 else:
> > 116 initial_size = 0
> > --> 117 _get_http(url, temp_file_name, initial_size, timeout, verbose_bool)
> > 118
> > 119 # check hash sum eg md5sum
> > /export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne20/lib/python3.8/site-packages/mne/utils/fetching.py in _get_http(failed resolving arguments)
> > 53 del file_size
> > 54 chunk_size = 8192 # 2 ** 13
> > ---> 55 with open(temp_file_name, mode) as local_file:
> > 56 while True:
> > 57 t0 = time.time()
> > FileNotFoundError: [Errno 2] No such file or directory: '/na/homes/mschendel/mne_data/MNE-sample-data-processed.tar.gz.part'
> > In [7]: sample
> > Out[7]: <module 'mne.datasets.sample' from '/export/research/analysis/human/jstephen/shared/programs/python/anaconda_072020/new/envs/mne20/lib/python3.8/site-packages/mne/datasets/sample/init.py'>
> > MEG Technician
> > The Mind Research Network
> > 1101 Yale Blvd. NE
> > Albuquerque, New Mexico 87106
> >
> > Mne_analysis mailing list
> > Mne_analysis at nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis





More information about the Mne_analysis mailing list