# How to remove Syntax error when doing mne\_edf2fiff conversion

**URL:** <https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116>\
**Category:** Support & Discussions\
**Tags:** meg, eeg, visualization, raw\
**Created:** [December 11, 2021, 9:15pm UTC](https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116 "2021-12-11T21:15:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [December 11, 2021, 9:15pm UTC](https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116/1 "2021-12-11T21:15:41Z")

</div>

I am new to MNE python, and wanted to convert the raw file provided to me in edf format to .fif format. However, I came across this problem. I was wondering if anyone could help me with resolving the issue. I am sharing the code below:

````python
import pathlib

import mne
import mne_bids

matplotlib.use('Qt5Agg')

import numpy as py

import pyedflib

cd C:\Users\sxb2391\Downloads\Files

mne_edf2fiff --edf Try.edf --fif Recording_9_fil.fif ```

And this was the error I obtained:

File "C:\Users\sxb2391\AppData\Local\Temp/ipykernel_12080>>/372198582.py", line 1
   mne_edf2fiff --edf Try.edf --fif Recording_9_fil.fif
                      ^
SyntaxError: invalid syntax
Could someone help me with solving this error. That would be of great help.
````

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [December 12, 2021, 5:16pm UTC](https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116/2 "2021-12-12T17:16:41Z")

</div>

mne\_edf2fiff is not a command from mne-python. It’s an old command from mne-c

In Python something like this should work:

import mne  
raw = mne.io.read\_raw\_edf(“Try.edf”)  
raw.save(“Recording\_9\_fil.fif”)

---

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [December 12, 2021, 5:55pm UTC](https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116/3 "2021-12-12T17:55:50Z")

</div>

Hi Alex, I tried doing that but the problem is I cant open my edf file as it shows me the given string to float conversion problem.

 ![error](https://global.discourse-cdn.com/free1/uploads/mne/original/2X/6/6dd55fafb33e727213a122448f3fb99a657484c3.png)

---

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [December 12, 2021, 5:56pm UTC](https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116/4 "2021-12-12T17:56:24Z")

</div>

How can I remove this issue?

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [December 12, 2021, 9:07pm UTC](https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116/5 "2021-12-12T21:07:44Z")

</div>

Hello, oils you possibly share the problematic file with us so we can have a closer look?

btw it is recommended to paste code and error messages as text (and mark it at “preformatted” using the respective toolbar button) to make it easier to read and allow others to find it using our search function.

Thanks,  
Richard

---

<div class="post-metadata">

**Author:** ![Subrat\_Bastola](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/subrat_bastola/32/1190_2.png) [@Subrat\_Bastola](https://mne.discourse.group/u/Subrat_Bastola)\
**Post date:** [December 13, 2021, 12:32am UTC](https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116/6 "2021-12-13T00:32:09Z")

</div>

Hi @richard, here I am sharing a link to that file.

> **[TD005\_CombinedMEGHDEEG\_Run01\_bl\_notch\_band.edf](https://drive.google.com/file/d/10nCLziP1HZGXzHqOTsJjjQBLzMwd9Cto/view?usp=sharing)**
>
> Google Drive file.

I was wondering if you could tell me if there is a way I can work on processed raw data imported from brainstorm(combined HD-EEG and MEG) to work on it in MNE? In other words, I want to export file from brainstorm in.bst format and open it on MNE. How can I do that?

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [December 13, 2021, 8:45am UTC](https://mne.discourse.group/t/how-to-remove-syntax-error-when-doing-mne-edf2fiff-conversion/4116/7 "2021-12-13T08:45:08Z")

</div>

I would check if you can read this file with [https://www.teuniz.net/edfbrowser/](https://www.teuniz.net/edfbrowser/)

try with eeglab / biosig to load the files leads to many warnings and one related I think

WARNING SOPEN(GDF/BDF/EDF): Scaling factor is not defined in following channels:

…

so this file seems problematic

Alex
