Issue with example in mne.datasets.eegbci.data_path()

External Email - Use Caution

Hello,
I am trying to run a script based on the example in method data_path from
mne.datasets.eegbci:

import os
from mne.datasets import eegbci

url = 'Index of /static/published-projects/eegmmidb/1.0.0/
eegbci.data_path(url, os.getenv('HOME') + '/datasets')

and get the following error:
...
File
"/home/user/venv/torch/lib/python3.7/site-packages/mne/utils/fetching.py",
line 173, in _fetch_file
    shutil.move(temp_file_name, file_name)
  File "/home/user/venv/torch/lib/python3.7/shutil.py", line 564, in move
    raise Error("Destination path '%s' already exists" % real_dst)
shutil.Error: Destination path
'/home/user/datasets/MNE-eegbci-data/files/eegmmidb/1.0.0/.part' already
exists

I clarify that the folder did not previously exist.
What could be the problem?

Best regards,

Ramiro Gatti
PhD Fellow
IBB-CONICET
<CONICET | Buscador de Institutos y Recursos Humanos;

LIRINS <http://www.ingenieria.uner.edu.ar/grupos/lirins/&gt; | FI

<http://www.ingenieria.uner.edu.ar/&gt;UNER <http://www.uner.edu.ar/&gt;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200306/254827ab/attachment.html

External Email - Use Caution

Hello!

Did you try eegbci.load_data instead of eegbci.data_path (according to the docs https://mne.tools/dev/generated/mne.datasets.eegbci.load_data.html#mne.datasets.eegbci.load_data)? What do you want to do in the first place?

Clemens

External Email - Use Caution

Yes, that way
<mne.datasets.eegbci.load_data — MNE 1.7.0.dev17+g20174f448 documentation;
it works. But theoretically the other script should also work based on
the description
of the function
<https://github.com/mne-tools/mne-python/blob/22dfbb5c55f09b88f595dd5c6d83dac71335df97/mne/datasets/eegbci/eegbci.py#L46&gt;\.
I do not understand what is wrong.

Ramiro Gatti
PhD Fellow
IBB-CONICET
<CONICET | Buscador de Institutos y Recursos Humanos;

LIRINS <http://www.ingenieria.uner.edu.ar/grupos/lirins/&gt; | FI

<http://www.ingenieria.uner.edu.ar/&gt;UNER <http://www.uner.edu.ar/&gt;

El vie., 6 mar. 2020 a las 12:34, Brunner, Clemens (
clemens.brunner at uni-graz.at) (<clemens.brunner at uni-graz.at>) escribi?:

        External Email - Use Caution

Hello!

Did you try eegbci.load_data instead of eegbci.data_path (according to the
docs
mne.datasets.eegbci.load_data — MNE 1.7.0.dev17+g20174f448 documentation)?
What do you want to do in the first place?

Clemens

>
> External Email - Use Caution
>
>
> Hello,
> I am trying to run a script based on the example in method data_path
from mne.datasets.eegbci:
>
> >>> import os
> >>> from mne.datasets import eegbci
> >>>
> >>> url = 'Index of /static/published-projects/eegmmidb/1.0.0/
> >>> eegbci.data_path(url, os.getenv('HOME') + '/datasets')
>
> and get the following error:
> ...
> File
"/home/user/venv/torch/lib/python3.7/site-packages/mne/utils/fetching.py",
line 173, in _fetch_file
> shutil.move(temp_file_name, file_name)
> File "/home/user/venv/torch/lib/python3.7/shutil.py", line 564, in move
> raise Error("Destination path '%s' already exists" % real_dst)
> shutil.Error: Destination path
'/home/user/datasets/MNE-eegbci-data/files/eegmmidb/1.0.0/.part' already
exists
>
> I clarify that the folder did not previously exist.
> What could be the problem?
>
> Best regards,
>
> Ramiro Gatti
> PhD Fellow
> IBB-CONICET | LIRINS | FIUNER
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200306/7a64e0dc/attachment-0001.html

External Email - Use Caution

The error is complaining about a `.part` file (i.e., partial download). Did you abort downloading on an earlier attempt, before you got this error? Does it work if you delete the `.part` file and try again?

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

??? Original Message ???

External Email - Use Caution

Yes, is true. The problem was in the path, it is necessary the full path as
argument, for example:

url = 'https://physionet.org/files/eegmmidb/1.0.0/S001/S001R06.edf

Thanks.

Regards,

Ramiro Gatti
PhD Fellow
IBB-CONICET
<https://www.conicet.gov.ar/new_scp/detalle.php?id=26815&info_general=yes&inst=yes&gt;

LIRINS <http://www.ingenieria.uner.edu.ar/grupos/lirins/&gt; | FI

<http://www.ingenieria.uner.edu.ar/&gt;UNER <http://www.uner.edu.ar/&gt;

El vie., 6 mar. 2020 a las 14:26, Dan McCloy (<dan at mccloy.info>) escribi?:

        External Email - Use Caution

The error is complaining about a `.part` file (i.e., partial download).
Did you abort downloading on an earlier attempt, before you got this
error? Does it work if you delete the `.part` file and try again?

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

??? Original Message ???

* External Email - Use Caution *

Yes, that way
<mne.datasets.eegbci.load_data — MNE 1.7.0.dev17+g20174f448 documentation;
it works. But theoretically the other script should also work based on the description
of the function
<https://github.com/mne-tools/mne-python/blob/22dfbb5c55f09b88f595dd5c6d83dac71335df97/mne/datasets/eegbci/eegbci.py#L46&gt;\.
I do not understand what is wrong.

Ramiro Gatti
PhD Fellow
IBB-CONICET
<CONICET | Buscador de Institutos y Recursos Humanos;
> LIRINS <http://www.ingenieria.uner.edu.ar/grupos/lirins/&gt; | FI
<http://www.ingenieria.uner.edu.ar/&gt;UNER <http://www.uner.edu.ar/&gt;

El vie., 6 mar. 2020 a las 12:34, Brunner, Clemens (
clemens.brunner at uni-graz.at) (<clemens.brunner at uni-graz.at>) escribi?:

        External Email - Use Caution

Hello!

Did you try eegbci.load_data instead of eegbci.data_path (according to
the docs
mne.datasets.eegbci.load_data — MNE 1.7.0.dev17+g20174f448 documentation)?
What do you want to do in the first place?

Clemens

>
> External Email - Use Caution
>
>
> Hello,
> I am trying to run a script based on the example in method data_path
from mne.datasets.eegbci:
>
> >>> import os
> >>> from mne.datasets import eegbci
> >>>
> >>> url = 'Index of /static/published-projects/eegmmidb/1.0.0/
> >>> eegbci.data_path(url, os.getenv('HOME') + '/datasets')
>
> and get the following error:
> ...
> File
"/home/user/venv/torch/lib/python3.7/site-packages/mne/utils/fetching.py",
line 173, in _fetch_file
> shutil.move(temp_file_name, file_name)
> File "/home/user/venv/torch/lib/python3.7/shutil.py", line 564, in
move
> raise Error("Destination path '%s' already exists" % real_dst)
> shutil.Error: Destination path
'/home/user/datasets/MNE-eegbci-data/files/eegmmidb/1.0.0/.part' already
exists
>
> I clarify that the folder did not previously exist.
> What could be the problem?
>
> Best regards,
>
> Ramiro Gatti
> PhD Fellow
> IBB-CONICET | LIRINS | FIUNER
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

_______________________________________________
Mne_analysis mailing list
Mne_analysis at nmr.mgh.harvard.edu
Mne_analysis Info Page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200306/be8698bb/attachment-0001.html