-
Notifications
You must be signed in to change notification settings - Fork 530
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
Matlab command cannot be found #2436
Comments
@jykim24 - you mentioned several issues here, will try to address at least some of them:
|
@djarecka
=================================================================== FAILURES ==================================================================== tmpdir = local('/private/var/folders/nf/6my3rs5d7kx9rvdr2jg72wsr0000gn/T/pytest-of-juyoungkim/pytest-26/test_CommandLine_output0')
E AssertionError: assert 'file' == 'stream' /Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/tests/test_core.py:441: AssertionError |
re 2: let's try to set the path manually, you can check If this helps, you can add |
I've tried, but 'print(spm.Info.name())' still gives 'None'. |
@djarecka from nipype.interfaces import spm above lines give me the following messages: 180212-19:58:09,71 interface DEBUG: It seems I can't run matlab from nipype, and that's causing the problems. Thanks in advance! |
can you try |
@jykim24 - can ask you to create a separate issue for the failing test? It doesn't seem to be related to your problems with spm and the tutorial. I personally never seen it and can't reproduce it, other people might have better ideas when they see it. |
Sure, I will create a separate issue for test failure. from nipype.interfaces import matlab When I run the code, I still get 'None' & 'None', and when I try to run a workflow, I get the following error: OSError Traceback (most recent call last) ~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/workflows.py in run(self, plugin, plugin_args, updatehash) ~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/plugins/linear.py in run(self, graph, config, updatehash) ~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py in run(self, updatehash) ~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py in _run_interface(self, execute, updatehash) ~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py in _run_command(self, execute, copyfiles) ~/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py in run(self, cwd, **inputs) ~/anaconda3/lib/python3.6/site-packages/nipype/interfaces/spm/base.py in _run_interface(self, runtime) ~/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py in run(self, cwd, **inputs) ~/anaconda3/lib/python3.6/site-packages/nipype/interfaces/matlab.py in _run_interface(self, runtime) ~/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py in _run_interface(self, runtime, correct_return_codes) OSError: No command "matlab" found on host Juyoungs-MacBook-Pro.local. Please check that the corresponding package is installed. |
@jykim24 - if you copied-pasted the exact code, there is a typo. |
Okay, I've tried the the code as below, but this still gives me 'none' as output. spm.SPMCommand.set_mlab_paths(paths='/Applications/MATLAB_R2016b.app/toolbox/spm12/', matlab_cmd='/Applications/MATLAB_R2016b -nodesktop -nosplash') |
@jykim24 - it seems you are on os x. your matlab command is likely to be:
|
thanks @satra, it was my mistake that I wrote that this should be path to matlab. |
@jykim24 - can you open a terminal and type:
if that returns empty, then type:
let's first make sure we can find matlab via the terminal. |
@satra |
I think for a newer versions of Matlab you have to modify a directory name to If this gives 'No such file or directory', you can always check the content of |
@djarecka @satra /Applications/MATLAB_R2016b.app/appdata/components/matlab |
ok, so you do have
|
Outputs of first and second commands look okay, but when I copy & paste the 3rd command on terminal, it returns 'Error: The expression to the left of the equals sign is not a valid target for an assignment.' |
@jykim24 - could you have some problems with copying the command? not sure what was wrong. If still doesn't work, you can go to python interpreter |
@djarecka - this |
@satra yes, I've been just checking this today and I also noticed that my |
ok, so I will open another issue with more specific description |
@jykim24 - can you please check if the current master solves your If you prefer to wait for an official release, we should have a new one in Monday. |
@jykim24 we just released version 1.0.1 that contains the fix for your spm problems. If you find time, can you please check it and confirm that you can now properly run |
I've updated the package and spm and matlab run properly. Thanks so much!!!! |
@jykim24 - great, thank you for checking it! |
Summary
Hello, I'm new to nipype and I am following preprocessing tutorial in the NypypeBeginnersGuide, and I cannot seem to run the workflow or write a graph.
The workflow unzips the file, but crashes at slice timing.
The crash file created states that matlab command cannot be found, but I have matlab 2016b and SPM12 installed.
Also, the error tells that 'No command 'dot' found' when I try to write a graph.
When testing nipype with nipype.test(), a fauilure occurs in test_Commandline().
I've deleted and reinstalled nipype twice, but this problem occurred both times.
How can I resolve these issues?
Actual behavior
When trying to write a graph,
OSError Traceback (most recent call last)
in ()
1 # 7. run workflow
----> 2 pp.write_graph(graph2use='flat')
~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/workflows.py in write_graph(self, dotfilename, graph2use, format, simple_form)
448 dotfilename=dotfilename,
449 format=format,
--> 450 simple_form=simple_form)
451
452 logger.info(
~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/utils.py in export_graph(graph_in, base_dir, show, use_execgraph, show_connectinfo, dotfilename, format, simple_form)
1285
1286 # Convert .dot if format != 'dot'
-> 1287 outfname, res = _run_dot(out_dot, format_ext=format)
1288 if res is not None and res.runtime.returncode:
1289 logger.warning('dot2png: %s', res.runtime.stderr)
~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/utils.py in _run_dot(dotfilename, format_ext)
1328 cmd = 'dot -T{} -o"{}" "{}"'.format(format_ext, formatted_dot, dotfilename)
1329 res = CommandLine(cmd, terminal_output='allatonce',
-> 1330 resource_monitor=False).run()
1331 return formatted_dot, res
1332
~/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py in run(self, cwd, **inputs)
513
514 try:
--> 515 runtime = self._run_interface(runtime)
516 outputs = self.aggregate_outputs(runtime)
517 except Exception as e:
~/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py in _run_interface(self, runtime, correct_return_codes)
1011 'No command "%s" found on host %s. Please check that the '
1012 'corresponding package is installed.' % (executable_name,
-> 1013 runtime.hostname))
1014
1015 runtime.command_path = cmd_path
OSError: No command "dot" found on host Juyoungs-MacBook-Pro.local. Please check that the corresponding package is installed.
When trying to run the workflow,
180212-11:06:51,706 workflow INFO:
Workflow preprocessing settings: ['check', 'execution', 'logging', 'monitoring']
180212-11:06:51,759 workflow INFO:
Running serially.
180212-11:06:51,763 workflow INFO:
[Node] Setting-up "preprocessing.selectfiles" in "/Users/juyoungkim/D_drive/spm_study_1702/spm_practice/nipype_tutorial/wd_preprocessing/preprocessing/_session_id_run001_subject_id_sub002/selectfiles".
180212-11:06:51,785 workflow INFO:
[Node] Running "selectfiles" ("nipype.interfaces.io.SelectFiles")
180212-11:06:51,823 workflow INFO:
[Node] Finished "preprocessing.selectfiles".
180212-11:06:51,825 workflow INFO:
[Node] Setting-up "preprocessing.gunzip" in "/Users/juyoungkim/D_drive/spm_study_1702/spm_practice/nipype_tutorial/wd_preprocessing/preprocessing/_session_id_run001_subject_id_sub002/gunzip".
180212-11:06:51,834 workflow INFO:
[Node] Cached "preprocessing.gunzip" - collecting precomputed outputs
180212-11:06:51,841 workflow INFO:
[Node] "preprocessing.gunzip" found cached.
180212-11:06:51,845 workflow INFO:
[Node] Setting-up "preprocessing.slice_timing" in "/Users/juyoungkim/D_drive/spm_study_1702/spm_practice/nipype_tutorial/wd_preprocessing/preprocessing/_session_id_run001_subject_id_sub002/slice_timing".
180212-11:06:51,898 workflow INFO:
[Node] Running "slice_timing" ("nipype.interfaces.spm.preprocess.SliceTiming")
180212-11:06:51,923 workflow WARNING:
[Node] Error on "preprocessing.slice_timing" (/Users/juyoungkim/D_drive/spm_study_1702/spm_practice/nipype_tutorial/wd_preprocessing/preprocessing/_session_id_run001_subject_id_sub002/slice_timing)
180212-11:06:51,929 workflow ERROR:
Node slice_timing.a1 failed to run on host Juyoungs-MacBook-Pro.local.
180212-11:06:51,972 workflow ERROR:
Saving crash info to /Users/juyoungkim/D_drive/spm_study_1702/spm_practice/nipype_tutorial/crash-20180212-110651-juyoungkim-slice_timing.a1-bffe58c0-53dd-4946-abe8-a60895ad07c9.pklz
Traceback (most recent call last):
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/pipeline/plugins/linear.py", line 44, in run
node.run(updatehash=updatehash)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 487, in run
result = self._run_interface(execute=True)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 571, in _run_interface
return self._run_command(execute)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 650, in _run_command
result = self._interface.run(cwd=outdir)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 515, in run
runtime = self._run_interface(runtime)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/spm/base.py", line 359, in _run_interface
results = self.mlab.run()
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 515, in run
runtime = self._run_interface(runtime)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/matlab.py", line 162, in _run_interface
runtime = super(MatlabCommand, self)._run_interface(runtime)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 1013, in _run_interface
runtime.hostname))
OSError: No command "matlab" found on host Juyoungs-MacBook-Pro.local. Please check that the corresponding package is installed.
Crash file states,
1_subject_id_sub001/slice_timing
Node inputs:
ignore_exception = False
in_files = ['/Users/juyoungkim/D_drive/spm_study_1702/spm_practice/nipype_tutorial/wd_preprocessing/preprocessing/_session_id_run001_subj
ect_id_sub001/slice_timing/run001.nii']
matlab_cmd =
mfile = True
num_slices = 40
out_prefix = a
paths =
ref_slice = 2
slice_order = [1.0, 3.0, 5.0, 7.0, 9.0, 11.0, 13.0, 15.0, 17.0, 19.0, 21.0, 23.0, 25.0, 27.0, 29.0, 31.0, 33.0, 35.0, 37.0, 39.0, 2.0, 4.
0, 6.0, 8.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 22.0, 24.0, 26.0, 28.0, 30.0, 32.0, 34.0, 36.0, 38.0, 40.0]
time_acquisition = 1.95
time_repetition = 2.0
use_mcr =
use_v8struct = True
Traceback:
Traceback (most recent call last):
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/pipeline/plugins/linear.py", line 44, in run
node.run(updatehash=updatehash)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 487, in run
result = self._run_interface(execute=True)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 571, in _run_interface
return self._run_command(execute)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py", line 650, in _run_command
result = self._interface.run(cwd=outdir)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 515, in run
runtime = self._run_interface(runtime)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/spm/base.py", line 359, in _run_interface
results = self.mlab.run()
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 515, in run
runtime = self._run_interface(runtime)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/matlab.py", line 162, in _run_interface
runtime = super(MatlabCommand, self)._run_interface(runtime)
File "/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/core.py", line 1013, in _run_interface
runtime.hostname))
OSError: No command "matlab" found on host Juyoungs-MacBook-Pro.local. Please check that the corresponding package is installed.
Expected behavior
Write a graph and run the preprocessing workflow.
How to replicate the behavior
Script/Workflow details
Please put URL to code or code here (if not too long).
Platform details:
Please paste the output of:
python -c "import nipype; print(nipype.get_info()); print(nipype.__version__)"
Execution environment
I'm running on Jupyter notebook, on Mac os, and have Nipype 1.0, MATLAB2016b and SPM12 installed.
Choose one
The text was updated successfully, but these errors were encountered: