Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying the tutorials #1

Open
friedrichkrohn opened this issue Feb 2, 2022 · 2 comments
Open

Error when trying the tutorials #1

friedrichkrohn opened this issue Feb 2, 2022 · 2 comments

Comments

@friedrichkrohn
Copy link

I tried the tutorials both as a Jupyter notebook and as a python script. When I tried executing the command

from brainsprite import viewer_substitute

bsprite = viewer_substitute(threshold=3, opacity=0.5, title="plot_stat_map",
cut_coords=[36, -27, 66])
bsprite.fit(stat_img, bg_img=anat)

I get the following error:


ImportError Traceback (most recent call last)
/var/folders/ck/szdm_4996pnb0qzqsb6pk4_r0000gp/T/ipykernel_67980/2301324209.py in
----> 1 from brainsprite import viewer_substitute
2
3 bsprite = viewer_substitute(threshold=3, opacity=0.5, title="plot_stat_map",
4 cut_coords=[36, -27, 66])
5 bsprite.fit(stat_img, bg_img=anat)

~/opt/anaconda3/lib/python3.9/site-packages/brainsprite/init.py in
1 """Brainsprite python API."""
----> 2 from .brainsprite import viewer_substitute
3
4 all = ['viewer_substitute']

~/opt/anaconda3/lib/python3.9/site-packages/brainsprite/brainsprite.py in
18 from nilearn.plotting.find_cuts import find_xyz_cut_coords
19 from nilearn.plotting.img_plotting import _load_anat
---> 20 from nilearn.reporting import HTMLDocument
21 from nilearn._utils.niimg_conversions import check_niimg_3d
22 from nilearn._utils.param_validation import check_threshold

ImportError: cannot import name 'HTMLDocument' from 'nilearn.reporting' (/Users/frkrohn/opt/anaconda3/lib/python3.9/site-packages/nilearn/reporting/init.py)

I am using Python 3.9.6 and a Jupyter in a conda environment

@pbellec
Copy link
Member

pbellec commented Feb 2, 2022

Thanks a lot for the bug report. I believe it may relate to an update in nilearn, I am going to run tests on my end but would you mind sharing the version of your nilearn install?

@pbellec
Copy link
Member

pbellec commented Feb 2, 2022

yes, I can confirm (EDIT: that nilearn update is the cause of the problem). It is now necessary to import HTMLDocument from nilearn.plotting.html_document. I am going to fix the bug, bump up the dependency requirements and prepare a new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants