TBC-TJU / MetaBCI

MetaBCI: China’s first open-source platform for non-invasive brain computer interface. The project of MetaBCI is led by Prof. Minpeng Xu from Tianjin University, China.
http://metabci.readthedocs.io/
GNU General Public License v2.0
370 stars 154 forks source link

python3.8, an error occurs when running stim_demo.py #30

Open HaveAnIdeaCy opened 1 year ago

HaveAnIdeaCy commented 1 year ago

Hello, there is a dependency package error when running the change file. Traceback (most recent call last): File "D:/PycharmProjects/MetaBCI/demos/brainstim_demos/stim_demo.py", line 3, in from metabci.brainstim.paradigm import SSVEP,P300,MI,AVEP,paradigm File "D:\PycharmProjects\MetaBCI\metabci\brainstim\paradigm.py", line 8, in from psychopy import data, visual, event File "C:\Users\13645\AppData\Roaming\Python\Python38\site-packages\psychopy\visual__init.py", line 28, in from .button import ButtonStim File "C:\Users\13645\AppData\Roaming\Python\Python38\site-packages\psychopy\visual\button.py", line 13, in from psychopy.visual.shape import BaseShapeStim File "C:\Users\13645\AppData\Roaming\Python\Python38\site-packages\psychopy\visual\shape.py", line 36, in from psychopy.contrib import tesselate File "C:\Users\13645\AppData\Roaming\Python\Python38\site-packages\psychopy\contrib\tesselate.py", line 52, in from pyglet.gl import ( ImportError: cannot import name 'gluErrorString' from 'pyglet.gl' (C:\Users\13645\AppData\Roaming\Python\Python38\site-packages\pyglet\gl\init__.py)

ch-MEIJIE commented 1 year ago

Hi, it seems like a package import error associated with Psychpy.

However, I did not see this error when test on our PC.

I find a link that may help you: https://discourse.psychopy.org/t/import-error-cannot-import-name-gluerrorstring-from-pyglet-gl/31705

Plz try it and let me know if the error still exist.

(OR you can try to install the MetaBCI dependent packages in a new virtual environment and see if it helps)

HaveAnIdeaCy commented 1 year ago

Great, thanks a lot for your help, pyglet 1.5 works, besides, the numpy package is updated to 1.24 and runs incorrectly, 1.23.5 is recommended.

HaveAnIdeaCy commented 1 year ago

When I tried to import local EEG data into datasets/base.py, I found that I couldn't know exactly if the array of dests [[],[]] was just a link to the address. For the _get_single_subject_data function sess and runs formats, How does it cut the data set in the paradigm?

ch-MEIJIE commented 1 year ago

Thanks for you suggestions on Numpy's version. We will check our dependent packages soon.

For import your own dataset (Do you mean this?), you can see this demo: demos/brainflow_demos/datasets.py.

For each dataset that is not contained in MetaBCI, you need to inherit the BaseDataset class and overwrite the _get_single_subject_data() and data_path() method, which convert data from raw files (which may vary from different EEG amplifier) into MNE Raw structure.