ImportError: cannot import name 'MultiDatasetClassify'
cpappas18 opened this issue · comments
Hi,
When I try to run neuropredict on the command line using
neuropredict -m ~/NeuroPredict/meta_data.csv -o ~/NeuroPredict/results/ --user_feature_paths ~/NeuroPredict/face/ ~/NeuroPredict/cnlg/ ~/NeuroPredict/glmn/ ~/NeuroPredict/cnsr/ ~/NeuroPredict/bimndir/ ~/NeuroPredict/bimnemo/ ~/NeuroPredict/msep/ -t 0.8 -n 20 -g 'light'
I get the error that ImportError: cannot import name 'MultiDatasetClassify' from 'pyradigm.multiple'
It appears that the multiple.py file that I've downloaded does not match the current version that is in your pyradigm repository. I installed it just now though, using pip3 install neuropredict. Do you know why I am getting this problem?
Thanks
Hi, it seems the pyradigm package was not installed properly. Could you try the following on the command line:
pip uninstall pyradigm --user
pip install -U pyradigm --user
Also, I would try use neuropredict_classify
or neuropredict_regress
directly instead of neuropredict
so its clear which task you are running.
If you run into further issues, please copy/paste the full command line output, including the command and everything after. Thanks.
Okay I've tried these suggestions and I'm getting the same error. Here's the entire output.
$ neuropredict_classify -m ~/Documents/NeuroPredict/meta_data.csv -o ~/Documents/NeuroPredict/results/ —user_feature_paths ~/Documents/NeuroPredict/face/ ~/Documents/NeuroPredict/cnlg/ ~/Documents/NeuroPredict/glmn/ ~/Documents/NeuroPredict/cnsr/ ~/Documents/NeuroPredict/bimndir ~/Documents/NeuroPredict/bimnemo/ ~/Documents/NeuroPredict/msep/ -t 0.8 -n 20 -g ‘light’
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/neuropredict_classify", line 7, in
from neuropredict.classify import main
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/neuropredict/init.py", line 38, in
from neuropredict import base, classify, regress, visualize
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/neuropredict/classify.py", line 11, in
from neuropredict.datasets import detect_missing_data, load_datasets
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/neuropredict/datasets.py", line 5, in
from pyradigm.multiple import MultiDatasetClassify, MultiDatasetRegress
ImportError: cannot import name 'MultiDatasetClassify'
Thanks.
interesting - can you try these :
pip uninstall neuropredict --user
pip install -U neuropredict --user
and then
neuropredict -v
pyradigm -h
and let me know the output?
$ neuropredict -v
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/neuropredict", line 7, in
from neuropredict.classify import main
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/neuropredict/init.py", line 38, in
from neuropredict import base, classify, regress, visualize
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/neuropredict/classify.py", line 11, in
from neuropredict.datasets import detect_missing_data, load_datasets
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/neuropredict/datasets.py", line 5, in
from pyradigm.multiple import MultiDatasetClassify, MultiDatasetRegress
ImportError: cannot import name 'MultiDatasetClassify'
$ pyradigm -h
usage: pyradigm [-h] [-m] [-i] [-a ADD_PATH_LIST [ADD_PATH_LIST ...]]
[-o OUT_PATH]
[path_list [path_list ...]]
positional arguments:
path_list List of paths to display info about.
optional arguments:
-h, --help show this help message and exit
-m, --meta Prints the meta data (subject_id,class).
-i, --info Prints summary info (classes, #samples, #features).
Options for multiple datasets:
-a ADD_PATH_LIST [ADD_PATH_LIST ...], --add ADD_PATH_LIST [ADD_PATH_LIST ...]
List of MLDatasets to combine
-o OUT_PATH, --out_path OUT_PATH
Output path to save the resulting dataset.
that's strange - this might be an issue with cache copies of old installations. Can you try these commands, and let me know the entire output you get?
Also, which operating system are you using?
python -m pip install --upgrade pip
pip uninstall pyradigm neuropredict
pip install -U pyradigm neuropredict --user --no-cache-dir
let me know the python version are you using with this command: python --version
Hold on - looks like I can reproduce the error here - let me get back to you on this
Hi @cpappas18, I fixed few install-related issues and re-released the related packages. Can you try these, and let me know the output:
python -m pip install --upgrade pip
pip uninstall pyradigm neuropredict
pip install -U pyradigm neuropredict --no-cache-dir
neuropredict_classify
if you see the last command print a large amount of text without an error at the end, then it's all in order and you can try your original command with features etc.
It's working now, thank you!
Great to hear that. Sorry you ran into these issues, and thanks for reporting the bug.
Were you able to obtain and follow the results, and use them as you needed, Chloe?
Yes it all worked for me, thank you.
Very glad to hear that. I'd appreciate if you could cite this software in your paper(s): https://raamana.github.io/neuropredict/citation.html