populse / populse_mia

Multiparametric Image Analysis
Other
10 stars 9 forks source link

Run problem with Windows 10, call system #178

Closed saldanhag closed 3 years ago

saldanhag commented 4 years ago

I am able to load a project, then to load a brick and connect every plug on it and initilize it. However, I can't run the pipeline, the process first ask nipype and next make a system request but it fails at this point.

I get the following error:

Traceback (most recent call last):                                                                                                                                                               File C:\Users\Megaport\Desktop\Stage\tmp\populse_mia\python\populse_mia\user_interface\pipeline_manager\pipeline_manager_tab.py", line 2065, in run 
   result = study_config.run(pipeline, verbose=1)
File "C:\Users\Megaport\Desktop\Stage\tmp\capsul\capsul\study_config\study_config.py", line 414, in run                                                                                         
  result, log_file = run_process(                                                                                                                                                             File "C:\Users\Megaport\Desktop\Stage\tmp\capsul\capsul\study_config\run.py", line 158, in run_process       
   returncode = process_instance._run_process() 
File "C:\Users\Megaport\Desktop\Stage\tmp\mia_processes\python\mia_processes\process_mia.py", line 68, in _run_process                                                                          self.run_process_mia()
File "C:\Users\Megaport\Desktop\Stage\tmp\mia_processes\python\mia_processes\preprocess\spm\spatial_preprocessing.py", line 1685, in run_process_mia
   self.process.run()
File "C:\Users\Megaport\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nipype\interfaces\base\core.py", line 353, in run
   self._check_version_requirements(self.inputs)
File "C:\Users\Megaport\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nipype\interfaces\base\core.py", line 275, in _check_version_requirements                                                                                                                                                                   
   if names and self.version:
File "C:\Users\Megaport\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nipype\interfaces\spm\base.py", line 358, in version
   info_dict = Info.getinfo(                                                                                                                                                                   File "C:\Users\Megaport\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nipype\interfaces\spm\base.py", line 227, in getinfo
    out = mlab.run()
File "C:\Users\Megaport\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nipype\interfaces\base\core.py", line 397, in run
   runtime = self._run_interface(runtime)
File "C:\Users\Megaport\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nipype\interfaces\matlab.py", line 170, in _run_interface
   runtime = super(MatlabCommand, self)._run_interface(runtime)
File "C:\Users\Megaport\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nipype\interfaces\base\core.py", line 791, in _run_interface
   runtime = run_command(runtime, output=self.terminal_output)
File "C:\Users\Megaport\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\nipype\utils\subprocess.py", line 103, in run_command
    proc = Popen(
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1264.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 854, in __init__
     self._execute_child(args, executable, preexec_fn, close_fds, 
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1264.0_x64__qbz5n2kfra8p0\lib\subprocess.py", line 1307, in _execute_child
      hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
TypeError: environment can only contain strings

This error occurs when I use SPM standalone ('C:/Users/Megaport/Desktop/Stage/spm12_r7771/spm12/spm12_win64.exe') from my computer.

If I type in PowerShell: C:/Users/Megaport/Desktop/Stage/spm12_r7771/spm12/spm12_win64.exe SPM open and if, in file explorer, I double click on the spm12_win64.exe, it also works.

Note: In File > Mia preferences, if I check Use SPM satndalone and I enter C:/Users/Megaport/Desktop/Stage/spm12_r7771/spm12/spm12_win64.exe for SPM standalone path, then click on OK, the configuration check is working fine.

I use Windows 10, python3.8, nipype 1.5.0.

denisri commented 4 years ago

I guess it says that one of the environment variables is not a string (maybe a number, or a "different" string such as bytes (encoded string), or a sting that cannot be encoded thhe way it expects). You can maybe investigate by printing the contents of os.environ (with value types, or at least using repr()) before that call to see if one of the variables has a different type from others.

servoz commented 3 years ago

With virtualisation, we can hope to do without Windows and we can close this ticket!