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

ModuleNotFoundError: No module named 'dipy.tracking.benchmarks' #56

Closed
funckjose1999 opened this issue Mar 6, 2024 · 8 comments
Closed

Comments

@funckjose1999
Copy link

Hi, when I tried to install dmriplayground on my computer (macOS Monterey), I met this error at last.
I installed FSL/dtiplayground tools successfully. I could also open the GUI smoothly. The error appeared when I tried
$ dmriprep init and also if I tried to run the analysis on a subject, the error will pop up. This error is dipy related error and I checked another computer which could run the analysis successfully that there won't be such module problem.

I tried reinstall dipy and also update it to the latest version, but it didn't work. Anyone has met this before? Could you please help me out with this issue?

Thank you!!!

[2024-03-06-15-17-45] Saving tool information to /Users/medpsych/.niral-dti/global_variables.yml
[2024-03-06-15-17-45] Installation completed
[2024-03-06-15-17-45] Config file written to : /Users/medpsych/.niral-dti/dmriprep-0.5.7/config.yml
[2024-03-06-15-17-45] DTI playground tools are found in /Users/medpsych/.niral-dti/dtiplayground-tools
[2024-03-06-15-17-45] FSL directory is found at /Users/medpsych/fsl
[2024-03-06-15-17-45] Software path file is written to : /Users/medpsych/.niral-dti/dmriprep-0.5.7/software_paths.yml
[2024-03-06-15-17-45] [_load_modules] begins ...
[2024-03-06-15-17-45] Loading modules from /Users/medpsych/anaconda3/envs/dtienv-py38/lib/python3.8/site-packages/dtiplayground/dmri/preprocessing/modules
[2024-03-06-15-17-45] Loading module : BASELINE_Average
[2024-03-06-15-18-14] Loading module : BRAIN_Mask
[2024-03-06-15-18-14] Loading module : BRAIN_Tractography
[2024-03-06-15-18-16] Traceback (most recent call last):
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/bin/dmriprep.py", line 237, in
[2024-03-06-15-18-16] result=args.func(args)
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/bin/dmriprep.py", line 40, in command_init
[2024-03-06-15-18-16] return app.initialize(options)
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/lib/python3.8/site-packages/dtiplayground/dmri/common/appbase.py", line 241, in initialize
[2024-03-06-15-18-16] self.initializeImpl(options)
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/lib/python3.8/site-packages/dtiplayground/dmri/preprocessing/app.py", line 53, in initializeImpl
[2024-03-06-15-18-16] modules=module.load_modules(system_module_paths = system_module_paths, user_module_paths=config['user_module_directories'])
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/lib/python3.8/site-packages/dtiplayground/dmri/common/init.py", line 83, in wrapper
[2024-03-06-15-18-16] res=func(*args,**kwargs)
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/lib/python3.8/site-packages/dtiplayground/dmri/common/module.py", line 18, in _load_modules
[2024-03-06-15-18-16] modules=_load_default_modules(system_module_paths, module_names, **options)
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/lib/python3.8/site-packages/dtiplayground/dmri/common/module.py", line 25, in _load_default_modules
[2024-03-06-15-18-16] return _load_modules_from_paths(system_module_paths,module_names, **options)
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/lib/python3.8/site-packages/dtiplayground/dmri/common/module.py", line 47, in _load_modules_from_paths
[2024-03-06-15-18-16] mods.append(p.module_finder.find_module(p.name).load_module(p.name))
[2024-03-06-15-18-16] File "", line 522, in _check_name_wrapper
[2024-03-06-15-18-16] File "", line 1022, in load_module
[2024-03-06-15-18-16] File "", line 847, in load_module
[2024-03-06-15-18-16] File "", line 265, in _load_module_shim
[2024-03-06-15-18-16] File "", line 702, in _load
[2024-03-06-15-18-16] File "", line 671, in _load_unlocked
[2024-03-06-15-18-16] File "", line 843, in exec_module
[2024-03-06-15-18-16] File "", line 219, in _call_with_frames_removed
[2024-03-06-15-18-16] File "/Users/medpsych/anaconda3/envs/dtienv-py38/lib/python3.8/site-packages/dtiplayground/dmri/preprocessing/modules/BRAIN_Tractography/BRAIN_Tractography.py", line 9, in
[2024-03-06-15-18-16] from dipy.tracking.benchmarks.bench_streamline import length
[2024-03-06-15-18-16] ModuleNotFoundError: No module named 'dipy.tracking.benchmarks'

@styner
Copy link
Member

styner commented Mar 7, 2024

Have not seen this issue before. This seems a version issue with dipy. Which version of dipy are you using?

@funckjose1999
Copy link
Author

Have not seen this issue before. This seems a version issue with dipy. Which version of dipy are you using?

Hi! Thank you! I used the latest version of dipy, which is 1.8.0. I tried uninstall and reinstall dipy, but it didn’t work.

@styner
Copy link
Member

styner commented Mar 7, 2024

I do not see the benchmarks function in dipy's tracking module at 1.8. It is in 1.6, thus it might be best to downgrade to 1.6 until we correct the code

@styner
Copy link
Member

styner commented Mar 7, 2024

The tractography module uses the length of a tract in its processing, that function was provided by dipy.tracking.benchmarks in 1.6 and it switched to dipy.tracking.metrics for 1.8 (which is probably a better location for it). We will need to write a version depending import.

@styner
Copy link
Member

styner commented Mar 8, 2024

Updated comments above. The API change happened in version 1.7 (from 1.6)

@styner
Copy link
Member

styner commented Mar 8, 2024

New version dtiplayground 0.5.8b6 is available, can you update your local package and retry
pip install --upgrade dtiplayground==0.5.8b6

@styner styner closed this as completed Mar 11, 2024
@styner
Copy link
Member

styner commented Mar 11, 2024

Version 0.5.8b6 solves this issue

@funckjose1999
Copy link
Author

New version dtiplayground 0.5.8b6 is available, can you update your local package and retry pip install --upgrade dtiplayground==0.5.8b6

Thank you very much!!!

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