Issue when using EDFRecordingExtractor with pyEDFlib
To use EDFRecordingExtractor, I installed pyEDFlib. It works well for extracting the data, but when I start to run sorters, it shows the error below.
File ~.conda\envs\si_env\lib\site-packages\neo\rawio\edfrawio.py:70, in EDFRawIO._parse_header(self) 67 if ('EDF+' in file_version_header) and ('EDF+C' not in file_version_header): 68 raise ValueError('Only continuous EDF+ files are currently supported.') ---> 70 self.edf_reader = EdfReader(self.filename) 71 # load headers, signal information and 72 self.edf_header = self.edf_reader.getHeader()
File pyedflib_extensions_pyedflib.pyx:146, in pyedflib._extensions._pyedflib.CyEdfReader.init()
File pyedflib_extensions_pyedflib.pyx:209, in pyedflib._extensions._pyedflib.CyEdfReader.open()
File pyedflib_extensions_pyedflib.pyx:181, in pyedflib._extensions._pyedflib.CyEdfReader.check_open_ok()
OSError: C:\Users\betty\Desktop\SpikeInterface\EDF\Week2Day1_220822_155852_section1.edf: file has already been opened
I don't know how to close it. Please help me with it.
Have you tried the close() method?
To help any more, I'll need to see more of your code.
Thanks! Here is my code. https://github.com/betty6you/EDFRecordingExtractor/blob/main/EDF_extractor_test.ipynb
Yes, you need to actually execute the cell with close() and then the file will be closed
