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

ImportError: cannot import name 'MultiDatasetClassify' #60

Closed
cpappas18 opened this issue Jul 22, 2020 · 13 comments
Closed

ImportError: cannot import name 'MultiDatasetClassify' #60

cpappas18 opened this issue Jul 22, 2020 · 13 comments

Comments

@cpappas18
Copy link

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

@raamana
Copy link
Owner

raamana commented Jul 22, 2020

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.

@cpappas18
Copy link
Author

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.

@raamana
Copy link
Owner

raamana commented Jul 22, 2020

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?

@cpappas18
Copy link
Author

$ 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.

@raamana
Copy link
Owner

raamana commented Jul 22, 2020

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

@raamana
Copy link
Owner

raamana commented Jul 22, 2020

let me know the python version are you using with this command: python --version

@raamana
Copy link
Owner

raamana commented Jul 22, 2020

Hold on - looks like I can reproduce the error here - let me get back to you on this

@raamana
Copy link
Owner

raamana commented Jul 22, 2020

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.

@cpappas18
Copy link
Author

It's working now, thank you!

@raamana
Copy link
Owner

raamana commented Jul 23, 2020

Great to hear that. Sorry you ran into these issues, and thanks for reporting the bug.

@raamana raamana closed this as completed Jul 23, 2020
@raamana
Copy link
Owner

raamana commented Jul 28, 2020

Were you able to obtain and follow the results, and use them as you needed, Chloe?

@cpappas18
Copy link
Author

Yes it all worked for me, thank you.

@raamana
Copy link
Owner

raamana commented Aug 2, 2020

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

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