# Error message for Beginning Tutorial

**URL:** <https://mne.discourse.group/t/error-message-for-beginning-tutorial/3285>\
**Category:** Support & Discussions\
**Created:** [June 19, 2021, 7:50pm UTC](https://mne.discourse.group/t/error-message-for-beginning-tutorial/3285 "2021-06-19T19:50:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![thimo123](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@thimo123](https://mne.discourse.group/u/thimo123)\
**Post date:** [June 19, 2021, 7:50pm UTC](https://mne.discourse.group/t/error-message-for-beginning-tutorial/3285/1 "2021-06-19T19:50:19Z")

</div>

- MNE-Python version: 3.7.2
- operating system: Mac OS 11.2.2

I am a new user trying to learn MNE via the tutorials. On the beginning tutorial, “Overview of MEG/EEG Analysis with MNE-Python”, I am not able to make it very far by following the given instructions. The first line of code given executes well, but the second line of code given (“sample\_data\_raw\_file = os.path.join(sample\_data\_folder, ‘MEG’, ‘sample’, ‘sample\_audvis\_filt-0-40\_raw.fif’)” ) produces the error “TypeError: expected str, bytes or os.PathLike object, not module”.

---

<div class="post-metadata">

**Author:** ![marsipu](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/marsipu/32/196_2.png) [@marsipu](https://mne.discourse.group/u/marsipu)\
**Post date:** [June 20, 2021, 8:07am UTC](https://mne.discourse.group/t/error-message-for-beginning-tutorial/3285/2 "2021-06-20T08:07:23Z")

</div>

Hello Thimo,  
good that you ask directly, something like that shouldn’t prevent you from learning MNE-Python 🙂. Do you use exactly [the code provided](https://mne.tools/stable/auto_tutorials/intro/10_overview.html#sphx-glr-auto-tutorials-intro-10-overview-py)?  
Maybe you can try downloading the script at the bottom of the page and run it from the terminal with

```python
python 10_overview.py

```

(being in the directory where you downloaded it and having activated your mne-conda-environment) just to see if it works then.  
I could reproduce this error for example when I put

```python
sample_data_folder = mne.datasets.sample

```

instead of

```python
sample_data_folder = mne.datasets.sample.data_path()

```

---

<div class="post-metadata">

**Author:** ![thimo123](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@thimo123](https://mne.discourse.group/u/thimo123)\
**Post date:** [June 21, 2021, 12:15am UTC](https://mne.discourse.group/t/error-message-for-beginning-tutorial/3285/3 "2021-06-21T00:15:47Z")

</div>

Martin,

Thank you so much for your reply. Yes, I used the code exactly as provided. I tried both with “.sample” at the end as well as with “.sample.data\_path()”. I also tried downloading the dataset directly from OpenNeuro using Node.js, putting the folder in the same directory I am using for MNE-Python, and naming the folder “sample”.

I will try downloading the script at the bottom of the page as you suggest.

Thank you again for your help!

---

<div class="post-metadata">

**Author:** ![marsipu](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/marsipu/32/196_2.png) [@marsipu](https://mne.discourse.group/u/marsipu)\
**Post date:** [June 21, 2021, 10:10am UTC](https://mne.discourse.group/t/error-message-for-beginning-tutorial/3285/4 "2021-06-21T10:10:32Z")

</div>

Hey Thimo,  
sure, you’re welcome:).  
Leaving out `.data_path()` was just an example for trying to understand where your original Error-Message came from.  
Going from the error-message you provided there was a module-object inside of `os.path.join()` where we would expect a string-object instead.  
The sample-data is usually stored and loaded from a folder “mne\_data” inside your home-directory. That is maybe not the same directory you use for MNE-Python.  
You can check the location of your sample-data with

```python
import mne
mne.get_config('MNE_DATASETS_SAMPLE_PATH')

```

The first time you run `mne.datasets.sample.data_path()` when there is no data at this location, the dataset should be downloaded automatically.  
You can also insert a path into `mne.datasets.sample.data_path()` when you want your sample-data to be stored there.
