We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Cannot download any annotation due to path error: str object has no attribute mkdir, triggered in nilearn's fetch_single_file.
str object has no attribute mkdir
fetch_single_file
Apparently in version 0.11.0 of nilearn, they require a Path object for data_dir, while in fetch_annotation.py, l288 the data dir is casted to string.
data_dir
Removing the str(data_dir) fixes issue, but it will be incompatible with older nilearn.
str(data_dir)
No response
pip install -U nilearn=0.11.0 from pathlib import Path p = Path(r'C:/Users/asala/neuromaps-data') from neuromaps.datasets import fetch_annotation from neuromaps.datasets import available_annotations for annotation in available_annotations(tags='PET'): print(annotation) fetch_annotation(source=annotation[0], desc=annotation[1], space=annotation[2], den=annotation[3], data_dir=p)
neuromaps
The text was updated successfully, but these errors were encountered:
Hi, thanks so much for reporting and pinpointing the bug! I've opened a PR for this.
Removing the str() works for me for both 0.11.0 and 0.10.X versions. May I ask which older nilearn version would be incompatible on your end? Thanks!
str()
0.11.0
0.10.X
Sorry, something went wrong.
I checked with nilearn 0.10.4, and it accepts the string object instead of path, and use the usual os.path functions.
os.path
os.path accepts Path objects since Python3.6, so I feel it is actually safe to remove the cast to string.
No branches or pull requests
Issue summary
Cannot download any annotation due to path error:
str object has no attribute mkdir
, triggered in nilearn'sfetch_single_file
.Apparently in version 0.11.0 of nilearn, they require a Path object for
data_dir
, while in fetch_annotation.py, l288 the data dir is casted to string.Removing the
str(data_dir)
fixes issue, but it will be incompatible with older nilearn.Detailed issue description
No response
Steps to reproduce issue
Software version
No response
Code of Conduct
neuromaps
Code of ConductThe text was updated successfully, but these errors were encountered: