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

Open
jeremymoreau opened this issue Jul 14, 2019 · 0 comments

Comments

@jeremymoreau
Copy link

commented Jul 14, 2019

Summary

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

Actual behavior

Traceback (most recent call last):
  File "test.py", line 7, in <module>
    coreg.run()
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\base\core.py", line 334, in run
    self._check_version_requirements(self.inputs)
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\base\core.py", 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\base.py", line 351, in version
    use_mcr=self.inputs.use_mcr)
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\spm\base.py", line 218, in getinfo
    out = mlab.run()
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\base\core.py", line 375, in run
    runtime = self._run_interface(runtime)
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\site-packages\nipype\interfaces\matlab.py", 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\core.py", 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\subprocess.py", line 115, in run_command
    close_fds=(not sys.platform.startswith('win')),
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "C:\Users\jerem\Anaconda3\envs\nipype_test\lib\subprocess.py", line 1178, in _execute_child
    startupinfo)
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()
coreg.inputs.target = "C:/Users/jerem/code/test/t1.nii"
coreg.inputs.source = "C:/Users/jerem/code/test/spect.nii"
coreg.terminal_output = 'none'
coreg.run()

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
Thanks!

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