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

Error with spm.coregister on Windows (TypeError: environment can only contain strings) #2958

jeremymoreau opened this issue Jul 14, 2019 · 0 comments


Copy link

commented Jul 14, 2019


I am running into the following error when attempting to use spm.Coregister() on Windows.

Actual behavior

Traceback (most recent call last):
  File "", line 7, in <module>
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\base\", line 334, in run
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\base\", line 257, in _check_version_requirements
    if names and self.version:
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\spm\", line 351, in version
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\spm\", line 218, in getinfo
    out =
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\base\", line 375, in run
    runtime = self._run_interface(runtime)
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\", line 162, in _run_interface
    runtime = super(MatlabCommand, self)._run_interface(runtime)
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\base\", line 755, in _run_interface
    runtime = run_command(runtime, output=self.terminal_output)
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\utils\", line 115, in run_command
    close_fds=(not sys.platform.startswith('win')),
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\", line 1178, in _execute_child
TypeError: environment can only contain strings

Expected behavior

No error. This works fine on Linux (I am trying to port a command line tool I wrote to Windows).

How to replicate the behavior

Run the example code below (with any two nifti file to be coregistered).

Script/Workflow details

from nipype.interfaces import spm

coreg = spm.Coregister() = "C:/Users/jerem/code/test/t1.nii"
coreg.inputs.source = "C:/Users/jerem/code/test/spect.nii"
coreg.terminal_output = 'none'

Platform details:

{'commit_hash': '%h',
 'commit_source': 'archive substitution',
 'networkx_version': '2.3',
 'nibabel_version': '2.4.1',
 'nipype_version': '1.2.0',
 'numpy_version': '1.16.4',
 'pkg_path': 'C:\\Users\\jerem\\Anaconda3\\envs\\nipype_test\\lib\\site-packages\\nipype',
 'scipy_version': '1.2.1',
 'sys_executable': 'C:\\Users\\jerem\\Anaconda3\\envs\\nipype_test\\python.exe',
 'sys_platform': 'win32',
 'sys_version': '3.7.3 | packaged by conda-forge | (default, Jul  1 2019, '
                '22:01:29) [MSC v.1900 64 bit (AMD64)]',
 'traits_version': '5.1.2'}

Execution environment

Choose one

  • My python environment outside container

I'm running nipype in a fresh conda env with nothing else installed.

This issue also seems related: #2509

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.