在python/Atom中导入mne包时语法无效

2024-10-01 17:38:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我想知道你们谁能帮我解决这个问题。 我正在尝试使用python中的MNE包来分析EEG数据。我在Linux 18.04上运行。你知道吗

我安装了Atom的最新版本和MNE by PIP+所有的科学软件包(numpy、pandas等)。 我打开Atom并键入:

    import mne

然后我运行它,得到以下错误:

Traceback (most recent call last):
  File "/tmp/atom_script_tempfiles/9b375e90-191b-11ea-b755-49276afb2bfa", line 3, in <module>
    import mne
  File "/home/vmh/.local/lib/python2.7/site-packages/mne/__init__.py", line 22, in <module>
    from .utils import (set_log_level, set_log_file, verbose, set_config,
  File "/home/vmh/.local/lib/python2.7/site-packages/mne/utils/__init__.py", line 19, in <module>
    from .config import (set_config, get_config, get_config_path, set_cache_dir,
  File "/home/vmh/.local/lib/python2.7/site-packages/mne/utils/config.py", line 539
    print(out, end='', file=fid)
                  ^
SyntaxError: invalid syntax

有人知道怎么修吗?你知道吗

提前谢谢。你知道吗


Tags: inpyimportconfighomelibpackageslocal
1条回答
网友
1楼 · 发布于 2024-10-01 17:38:57

上一部分中的语句tracebackprint(out, end='', file=fid)在python2.7中不兼容。你知道吗

同样来自项目github页面(https://github.com/mne-tools/mne-python

Note that MNE-Python 0.17 was the last release to support Python 2. MNE-Python 0.18 only works under Python 3, and MNE-Python 0.19 requires Python 3.5 or higher.

由于Python2.7不久将不受支持(https://pythonclock.org),我建议您更新到Python3。如果无法升级到python3,请改用MNE版本0.17。你知道吗

相关问题 更多 >

    热门问题