Using nipype without Docker

Hey folks,

I am completely new to nipype (and also to docker) and would like to switch over to it in order to avoid working with different softwares differently. It seems like a lot of nipype users seem to use docker in order to run their analyses. However, my IT department doesn’t want to install docker on the server which I am working on (where my data and software is stored).

So, what I did was to start simple and to just install nipype on my personal machine (Windows 10) using:

conda install --channel conda-forge nipype

I also have MATLABR2020a and SPM12 installed on my machine. I just wanted ro run a super simple toy example where one single image is smoothed:

import nipype.interfaces.spm as spm
smooth = spm.Smooth()
smooth.inputs.in_files = "path/to/my/nifti_file.nii"
smooth.inputs.fwhm = [4, 4, 4]
smooth.run() 

Two things to that:

1.) First of all I got an error (which might be related to this issue on GitHub):

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\nipype\interfaces\base\core.py", line 375, in run
    self._check_version_requirements(self.inputs)

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\nipype\interfaces\base\core.py", line 275, in _check_version_requirements
    if names and self.version:

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\nipype\interfaces\spm\base.py", line 358, in version
    info_dict = Info.getinfo(

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\nipype\interfaces\spm\base.py", line 227, in getinfo
    out = mlab.run()

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\nipype\interfaces\base\core.py", line 419, in run
    runtime = self._run_interface(runtime)

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\nipype\interfaces\matlab.py", line 170, in _run_interface
    runtime = super(MatlabCommand, self)._run_interface(runtime)

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\nipype\interfaces\base\core.py", line 812, in _run_interface
    runtime = run_command(runtime, output=self.terminal_output)

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\nipype\utils\subprocess.py", line 103, in run_command
    proc = Popen(

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 105, in __init__
    super(SubprocessPopen, self).__init__(*args, **kwargs)

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,

  File "C:\Users\Johannes.Wiesner\.conda\envs\csp\lib\subprocess.py", line 1307, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

TypeError: environment can only contain strings

2.) I just got a simple question: How does nipype know where my MATLAB version and SPM is laying on my PC? As far as I understood, nipype contains wrapper functions that open instances of those softwares in the background which again execute the actual code that transforms my images, runs analyses on them, etc. So for example, if want to use nipype to run SPM commands on my personal machine (as in the example code above), what is nipype doing in the background? Does it search for SPM and MATLAB on my PC? Why do I not need to provide it with paths to MATLAB and SPM?

Ahoi hoi @JohannesWiesner,

a few thoughts: if your IT department doesn’t allow Docker (which most don’t and what is fair given the whole “root privileges” thing) you could ask them if Singularity would be ok (a user is the “same” inside and outside the container, no need for root except during the installation of Singularity). It works very comparable to Docker and can even make use of Docker images. Most HPCs have Singularity installed, allow and support it. NB: as you might be aware, the Windows OS comes with some limitations regarding a lot of these things.

Now to your actual questions. You’re absolutely right in that nipype contains wrapper functions, that is the actual functions are run in the background. That’s exactly why it needs to know where the actual software is on your machine, otherwise it wouldn’t be able to call and run it. Thus, you have to set and define paths to the external software you want to use through nipype. This also holds true for SPM, as nipype needs to know where the SPM functions and your MATLAB installation are. @miykaelNipype Beginner’s Guide has a great section on how to install and set up nipype plus external software. The guide is outdated, but the commands and steps are still the same. NB: this was made for/is based on unix OS and therefore you would have to check how to adapt it for Windows. I’ve seen people using it there, but never tried it myself, sorry.

HTH, cheers, Peer

Thanks, Peer!

a few thoughts: if your IT department doesn’t allow Docker (which most don’t and what is fair given the whole “root privileges” thing) you could ask them if Singularity would be ok […]

Unfortunately, using either Docker or Singularity is not possible at the moment, but my IT department seems to be working on it. I hope that they will manage to set it up in the next weeks or months.

Now to your actual questions. You’re absolutely right in that nipype contains wrapper functions, that is the actual functions are run in the background. That’s exactly why it needs to know where the actual software is on your machine, otherwise it wouldn’t be able to call and run it. Thus, you have to set and define paths to the external software you want to use through nipype […]

Thanks for the link, that was exactly the information I was missing! Maybe I have overseen something but if I am not mistaken this is not described in the new tutorial? I guess since everyone (besides me and probably some other poor folks as well) is using nipype via Docker & Singularity, the ‘old-fashioned’ bare-metal-installation got a a little bit out of focus in the new tutorial and can therefore be only found in the old one ?

Anyways, I will try to set up a bare-metal installation und try to switch over to Docker & Singularity when it is officially set up in my institute, fingers crossed!

Ahoi hoi @JohannesWiesner,

sure thing, no biggie, glad it was helpful.

Ah damn, that’s a pity. I hope it get’s sorted out asap.
Yeah, the new tutorial doesn’t mention any install instruction as everything was moved to container based implementations given the many problems of bare
metal installations. Depending on your setup, it might be worth running the analyses in a container, already on your local machine. With that you can port things easily to your HPC resource once it’s ready. I’ll mark my previous answer as solution if that’s ok!?

Cheers, Peer

1 Like