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

Matlab command cannot be found #2436

Closed
jykim24 opened this issue Feb 12, 2018 · 27 comments
Closed

Matlab command cannot be found #2436

jykim24 opened this issue Feb 12, 2018 · 27 comments
Milestone

Comments

@jykim24
Copy link

jykim24 commented Feb 12, 2018

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

  • Container [Tag: ???]
  • My python environment inside container [Base Tag: ???]
  • My python environment outside container
@djarecka
Copy link
Collaborator

djarecka commented Feb 12, 2018

@jykim24 - you mentioned several issues here, will try to address at least some of them:

  • re. dot: write_graph function used in Nipypes requires a software called graphviz, I know there are some issues on OSX, as far as I remember brew install graphviz helped in my case. You can always check if you have dot in your terminal dot -V. FYI: you don't need dot to run the nipype workflow.

  • re spm: can you check what is the output python -c "from nipype.interfaces import spm; print(spm.Info.name())"?

  • re failing test: can you please share what is the failure message that you get from test_Commandline()

  • general comment: I'm not sure if NipypeBeginnersGuide has been updated recently (@miykael will know more) and don't know which example you're trying to run, but you can also check nipype tutorial that has been recently updated and tested.

@jykim24
Copy link
Author

jykim24 commented Feb 12, 2018

@djarecka
Thanks so much for the prompt reply!
I have been following the same tutorial on the link, using the flanker task dataset.

  1. dot: I didn't know dot is not mandatory to run the workflow. I haven't tried the command yet, but I will. Thanks for the tip!

  2. spm: the output of the code line says 'None', but I have SPM12 installed, and it's added to path in my MATLAB.

  3. test failure message:

=================================================================== FAILURES ====================================================================
____________________________________________________________ test_CommandLine_output ____________________________________________________________

tmpdir = local('/private/var/folders/nf/6my3rs5d7kx9rvdr2jg72wsr0000gn/T/pytest-of-juyoungkim/pytest-26/test_CommandLine_output0')

def test_CommandLine_output(tmpdir):
    # Create one file
    tmpdir.chdir()
    file = tmpdir.join('foo.txt')
    file.write('123456\n')
    name = os.path.basename(file.strpath)

    ci = nib.CommandLine(command='ls -l')
    ci.terminal_output = 'allatonce'
    res = ci.run()
    assert res.runtime.merged == ''
    assert name in res.runtime.stdout

    # Check stdout is written
    ci = nib.CommandLine(command='ls -l')
    ci.terminal_output = 'file_stdout'
    res = ci.run()
    assert os.path.isfile('stdout.nipype')
    assert name in res.runtime.stdout
    tmpdir.join('stdout.nipype').remove(ignore_errors=True)

    # Check stderr is written
    ci = nib.CommandLine(command='ls -l')
    ci.terminal_output = 'file_stderr'
    res = ci.run()
    assert os.path.isfile('stderr.nipype')
    tmpdir.join('stderr.nipype').remove(ignore_errors=True)

    # Check outputs are thrown away
    ci = nib.CommandLine(command='ls -l')
    ci.terminal_output = 'none'
    res = ci.run()
    assert res.runtime.stdout == '' and \
        res.runtime.stderr == '' and \
        res.runtime.merged == ''

    # Check that new interfaces are set to default 'stream'
    ci = nib.CommandLine(command='ls -l')
    res = ci.run()
  assert ci.terminal_output == 'stream'

E AssertionError: assert 'file' == 'stream'
E - file
E + stream

/Users/juyoungkim/anaconda3/lib/python3.6/site-packages/nipype/interfaces/base/tests/test_core.py:441: AssertionError
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
=============================================== 1 failed, 635 passed, 5 skipped in 29.46 seconds ================================================

@djarecka
Copy link
Collaborator

re 2: let's try to set the path manually, you can check python -c "from nipype.interfaces import spm; spm.SPMCommand.set_mlab_paths(paths='/your/path/to/spm'); print(spm.Info.name())"

If this helps, you can add spm.SPMCommand.set_mlab_paths at the beginning of the script to help nipype to find your spm.

@jykim24
Copy link
Author

jykim24 commented Feb 12, 2018

I've tried, but 'print(spm.Info.name())' still gives 'None'.
SPM runs just fine on Matlab, though.

@jykim24
Copy link
Author

jykim24 commented Feb 12, 2018

@djarecka
I've also tried to add path to .bash_profile but it didn't work either.

from nipype.interfaces import spm
from nipype import config, logging
config.enable_debug_mode()
logging.update_logging(config)
spm.SPMCommand.set_mlab_paths(paths='/Applications/MATLAB_R2016b/toolbox/spm12/')
print(spm.Info.name())
print(spm.SPMCommand().version)

above lines give me the following messages:

180212-19:58:09,71 interface DEBUG:
nodesktop_True
180212-19:58:09,75 interface DEBUG:
nosplash_True
180212-19:58:09,89 interface DEBUG:
single_comp_thread_True
180212-19:58:09,95 interface DEBUG:
No command "matlab" found on host Juyoungs-MacBook-Pro.local. Please check that the corresponding package is installed.
None
180212-19:58:09,104 interface DEBUG:
nodesktop_True
180212-19:58:09,117 interface DEBUG:
nosplash_True
180212-19:58:09,122 interface DEBUG:
single_comp_thread_True
180212-19:58:09,133 interface DEBUG:
No command "matlab" found on host Juyoungs-MacBook-Pro.local. Please check that the corresponding package is installed.
None

It seems I can't run matlab from nipype, and that's causing the problems.
Is there something I can try?

Thanks in advance!

@djarecka
Copy link
Collaborator

can you try spm.SPMCommand.set_mlab_paths(paths='/your/path/to/spm', matlab_cmd='/path/to/matlab -nodesktop -nosplash') instead of spm.SPMCommand.set_mlab_paths(paths='/your/path/to/spm')

@djarecka
Copy link
Collaborator

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

@jykim24
Copy link
Author

jykim24 commented Feb 13, 2018

@djarecka

Sure, I will create a separate issue for test failure.
For your suggested solution, I've tried running the following code.

from nipype.interfaces import matlab
from nipype.interfaces import spm
spm.SPMCommand.set_mlab_paths(paths='/Applications/MATLAB_R2016b.app/toolbox/spm12/')
matlab_cmd='/Applications/MATLAB_R2016b -nodesktop -nosplash'
print(spm.Info.name())

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)
in ()
----> 1 pp.run()

~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/workflows.py in run(self, plugin, plugin_args, updatehash)
600 if str2bool(self.config['execution']['create_report']):
601 self._write_report_info(self.base_dir, self.name, execgraph)
--> 602 runner.run(execgraph, updatehash=updatehash, config=self.config)
603 datestr = datetime.utcnow().strftime('%Y%m%dT%H%M%S')
604 if str2bool(self.config['execution']['write_provenance']):

~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/plugins/linear.py in run(self, graph, config, updatehash)
42 if self._status_callback:
43 self._status_callback(node, 'start')
---> 44 node.run(updatehash=updatehash)
45 if self._status_callback:
46 self._status_callback(node, 'end')

~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py in run(self, updatehash)
485
486 try:
--> 487 result = self._run_interface(execute=True)
488 except Exception:
489 logger.warning('[Node] Error on "%s" (%s)', self.fullname, outdir)

~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py in _run_interface(self, execute, updatehash)
569 self._update_hash()
570 return self._load_results()
--> 571 return self._run_command(execute)
572
573 def _load_results(self):

~/anaconda3/lib/python3.6/site-packages/nipype/pipeline/engine/nodes.py in _run_command(self, execute, copyfiles)
648 logger.info(message)
649 try:
--> 650 result = self._interface.run(cwd=outdir)
651 except Exception as msg:
652 result.runtime.stderr = '%s\n\n%s'.format(

~/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/spm/base.py in _run_interface(self, runtime)
357 self.mlab.inputs.script = self._make_matlab_command(
358 deepcopy(self._parse_inputs()))
--> 359 results = self.mlab.run()
360 runtime.returncode = results.runtime.returncode
361 if self.mlab.inputs.uses_mcr:

~/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/matlab.py in _run_interface(self, runtime)
160 def _run_interface(self, runtime):
161 self.terminal_output = 'allatonce'
--> 162 runtime = super(MatlabCommand, self)._run_interface(runtime)
163 try:
164 # Matlab can leave the terminal in a barbbled state

~/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 "matlab" found on host Juyoungs-MacBook-Pro.local. Please check that the corresponding package is installed.

@djarecka
Copy link
Collaborator

@jykim24 - if you copied-pasted the exact code, there is a typo. matlab_cmd should be an argument to set_mlab_paths, so try spm.SPMCommand.set_mlab_paths(paths='/Applications/MATLAB_R2016b.app/toolbox/spm12/', matlab_cmd='/Applications/MATLAB_R2016b -nodesktop -nosplash')

@jykim24
Copy link
Author

jykim24 commented Feb 13, 2018

@djarecka

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')
print(spm.Info.name())

@satra
Copy link
Member

satra commented Feb 13, 2018

@jykim24 - it seems you are on os x. your matlab command is likely to be:

/Applications/MATLAB_R2016b.app/bin/matlab -nodesktop -nosplash

@djarecka
Copy link
Collaborator

thanks @satra, it was my mistake that I wrote that this should be path to matlab.

@jykim24
Copy link
Author

jykim24 commented Feb 13, 2018

@satra @djarecka
Thanks, but even when I change matlab_cmd as you suggested, spm.Info.name() still gives me 'none'.

@satra
Copy link
Member

satra commented Feb 13, 2018

@jykim24 - can you open a terminal and type:

which matlab

if that returns empty, then type:

find /Applications/MATLAB_R2016b -name "matlab"

let's first make sure we can find matlab via the terminal.

@jykim24
Copy link
Author

jykim24 commented Feb 13, 2018

@satra
'which matlab' returns nothing, and the second line returns 'No such file or directory'.

@djarecka
Copy link
Collaborator

djarecka commented Feb 13, 2018

I think for a newer versions of Matlab you have to modify a directory name to /Applications/MATLAB_R2016.app, so try find /Applications/MATLAB_R2016b.app -name "matlab"

If this gives 'No such file or directory', you can always check the content of ls -l /Application to see what is the correct name of your matlab directory

@jykim24
Copy link
Author

jykim24 commented Feb 13, 2018

@djarecka @satra
find /Applications/MATLAB_R2016b.app -name "matlab" in terminal returns the following list.

/Applications/MATLAB_R2016b.app/appdata/components/matlab
/Applications/MATLAB_R2016b.app/appdata/files/matlab
/Applications/MATLAB_R2016b.app/bin/matlab
/Applications/MATLAB_R2016b.app/examples/matlab
/Applications/MATLAB_R2016b.app/extern/engines/python/dist/matlab
/Applications/MATLAB_R2016b.app/help/examples/matlab
/Applications/MATLAB_R2016b.app/help/matlab
/Applications/MATLAB_R2016b.app/java/jar/toolbox/matlab
/Applications/MATLAB_R2016b.app/mcr/toolbox/matlab
/Applications/MATLAB_R2016b.app/resources/coreui/matlab
/Applications/MATLAB_R2016b.app/sys/g11n/ja_JP/matlab
/Applications/MATLAB_R2016b.app/sys/g11n/ko_KR/matlab
/Applications/MATLAB_R2016b.app/sys/g11n/zh_CN/matlab
/Applications/MATLAB_R2016b.app/toolbox/compiler_sdk/mps_clients/python/dist/matlab
/Applications/MATLAB_R2016b.app/toolbox/compiler_sdk/pysdk_py/mlarray_dist/matlab
/Applications/MATLAB_R2016b.app/toolbox/eml/lib/matlab
/Applications/MATLAB_R2016b.app/toolbox/matlab
/Applications/MATLAB_R2016b.app/toolbox/matlab/datatools/inspector/matlab
/Applications/MATLAB_R2016b.app/toolbox/nnet/nnresource/nnet6/icon/general/matlab
/Applications/MATLAB_R2016b.app/toolbox/shared/dsp/vision/matlab

@djarecka
Copy link
Collaborator

ok, so you do have /Applications/MATLAB_R2016b.app/bin/matlab. I'm not sure why your workflow doesn't work, but let's try a few from commands from terminal (I know I already asked for some, but not sure if you run in basic python interpreter or jupyter notebook):

  • just to check if matlab command doesn't give any errors, in terminal: /Applications/MATLAB_R2016b.app/bin/matlab -nodesktop -nosplash

  • just to check that SPM path is ok, try to check content ls -l /Applications/MATLAB_R2016b.app/toolbox/spm12/. You should see hundreds of matlab scripts,*.m, you don't have to copy the output, just check if it's ok.

  • if output from both commands look ok, try again setting paths and command in nipype. please type in terminal (not in jupyter notebook):
    python -c "from nipype.interfaces import spm; spm.SPMCommand.set_mlab_paths(paths='/Applications/MATLAB_R2016b.app/toolbox/spm12/', matlab_cmd='/Applications/MATLAB_R2016b.app/bin/matlab -nodesktop -nosplash'); print(spm.Info.name()); print(spm.SPMCommand().version)"

@jykim24
Copy link
Author

jykim24 commented Feb 14, 2018

@djarecka

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

@djarecka
Copy link
Collaborator

@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 python and run following commands:
from nipype.interfaces import spm
spm.SPMCommand.set_mlab_paths(paths='/Applications/MATLAB_R2016b.app/toolbox/spm12/', matlab_cmd='/Applications/MATLAB_R2016b.app/bin/matlab -nodesktop -nosplash')
print(spm.Info.name())
print(spm.SPMCommand().version)

@satra
Copy link
Member

satra commented Feb 14, 2018

@djarecka - this print(spm.Info.name()) won't work properly because the paths and command set in SPMCommand does not carry over to Info

@djarecka
Copy link
Collaborator

@satra yes, I've been just checking this today and I also noticed that my spm.Info().name doesn't change after setting... Trying to check when this stopped working. Please let me know if you know when this happened.

@djarecka
Copy link
Collaborator

djarecka commented Feb 14, 2018

ok, so spm.SPMCommand().version stopped working correctly between 0.13.1 and 0.14.

I will open another issue with more specific description

@djarecka
Copy link
Collaborator

djarecka commented Feb 23, 2018

@jykim24 - can you please check if the current master solves your spm problem? Feel free to reopen the issue if it doesn't.

If you prefer to wait for an official release, we should have a new one in Monday.

@djarecka
Copy link
Collaborator

@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 spm interfaces. Thanks!

@jykim24
Copy link
Author

jykim24 commented Feb 28, 2018

@djarecka

I've updated the package and spm and matlab run properly.
Also, nipype.test() runs without failure as well.

Thanks so much!!!!

@djarecka
Copy link
Collaborator

@jykim24 - great, thank you for checking it!

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

4 participants