Skip to content

ImportError due to nilearn API change (nilearn>=0.10.3) #33

@Hyedryn

Description

@Hyedryn

When attempting to use giga_auto_qc, an ImportError is raised during the initialization phase. This issue is encountered when running the --help command or any other functionality provided by the tool. The error log is as follows:

Traceback (most recent call last): File "/home/qdessain/ukbb_scripts/giga_auto_qc/venv_autoqc/bin/giga_auto_qc", line 5, in <module> from giga_auto_qc.run import main File "/home/qdessain/ukbb_scripts/giga_auto_qc/venv_autoqc/lib/python3.10/site-packages/giga_auto_qc/run.py", line 4, in <module> from giga_auto_qc.workflow import workflow File "/home/qdessain/ukbb_scripts/giga_auto_qc/venv_autoqc/lib/python3.10/site-packages/giga_auto_qc/workflow.py", line 4, in <module> from giga_auto_qc import assessments, utils File "/home/qdessain/ukbb_scripts/giga_auto_qc/venv_autoqc/lib/python3.10/site-packages/giga_auto_qc/assessments.py", line 11, in <module> from nilearn.masking import intersect_masks, _load_mask_img ImportError: cannot import name '_load_mask_img' from 'nilearn.masking' (/home/qdessain/ukbb_scripts/giga_auto_qc/venv_autoqc/lib/python3.10/site-packages/nilearn/masking.py)

This issue seems to be caused by an api change in nilearn>0.10.2, where some functions prefixed with an underscore had their leading underscores removed. Downgrading to nilearn 0.10.2 resolves the issue.

Environment:

  • giga_auto_qc version: 0.3.4
  • Python version: 3.10.2
  • nilearn version: 0.10.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions