miykael / fmriflows

fmriflows is a consortium of many (dependent) fMRI analysis pipelines, including anatomical and functional pre-processing, univariate 1st and 2nd-level analysis, as well as multivariate pattern analysis.
BSD 3-Clause "New" or "Revised" License
60 stars 20 forks source link

06_analysis_multivariate “ImportError: cannot import name analyze” #38

Open donghui1119 opened 1 year ago

donghui1119 commented 1 year ago

Summary

It seems to be a problem with "nibabel", because "ImportError: cannot import name analyze" will appear when importing nibabel. But I still have this problem after I delete "nibabel" and reinstall it. I installed "nibabel==2.5.1" in python2.7 on my laptop, and there is no error in "import nibable"

Actual behavior

Expected behavior

How to replicate the behavior

Script/Workflow details

from mvpa2.suite import *


ImportError Traceback (most recent call last)

in () 2 import os 3 from os.path import basename ----> 4 from mvpa2.suite import * /opt/miniconda-latest/envs/mvpa/lib/python2.7/site-packages/mvpa2/suite.py in () 225 from mvpa2.misc.plot.base import * 226 from mvpa2.misc.plot.erp import * --> 227 from mvpa2.misc.plot.scatter import * 228 if externals.exists(['griddata', 'scipy']): 229 from mvpa2.misc.plot.topo import * /opt/miniconda-latest/envs/mvpa/lib/python2.7/site-packages/mvpa2/misc/plot/scatter.py in () 14 import sys, os 15 import pylab as pl ---> 16 import nibabel as nb 17 import numpy as np 18 /opt/miniconda-latest/envs/mvpa/lib/python2.7/site-packages/nibabel/__init__.py in () 60 61 # module imports ---> 62 from . import analyze as ana 63 from . import spm99analyze as spm99 64 from . import spm2analyze as spm2 ImportError: cannot import name analyze Please put URL to code or code here (if not too long). ### Platform details: ``` ``` ### Execution environment Ubuntu20.04 Choose one - Container [Tag: latest] - My python environment inside container [Base Tag: latest]
miykael commented 1 year ago

This is a strange error. I'm curious if it's more connected to PyMVPA than nibabel. Unfortunately, PyMVPA hasn't been improved since more than 4-years. At the time that I created fmriflows it was a great tool, but today I would rather recommend to switch to nilearn as it is still very actively developed and can do the same thing, plus much more.

donghui1119 commented 1 year ago

Thanks for your anwers, miykael. Yes, fmriflows is convenient and efficient to process data. I have run the previous process smoothly,I am preparing to introduce fmriflows to other students in the laboratory. But I also think that nilearn will be better for MVPA than pyMVPA.

miykael commented 1 year ago

For some tutorials on how to use nilearn, well, there's the nilearn documentation and the nilearn user guide. Additionally, you might find this resource helpful as well - in particular the following notebooks:

donghui1119 commented 1 year ago

Thanks for your sharing and kindness!