Skip to content

NiftyReg interface raises ValueError: invalid version number #2615

Closed
@fepegar

Description

@fepegar

Summary

Version number is "invalid" when I try to create a RegAladin node.

Actual behavior

C:\Users\fernando\tmp
(vesseg) λ python r.py
180612-15:47:29,796 interface WARNING:
         version_from_command member of CommandLine was Deprecated in nipype-1.0.0 and deleted in 1.1.0
Traceback (most recent call last):
  File "r.py", line 7, in <module>
    aladin = niftyreg.RegAladin()
  File "C:\Users\fernando\Miniconda3\envs\vesseg\lib\site-packages\nipype\interfaces\niftyreg\base.py", line 66, in __init__
    StrictVersion(_version) < StrictVersion(self._min_version):
  File "C:\Users\fernando\Miniconda3\envs\vesseg\lib\distutils\version.py", line 40, in __init__
    self.parse(vstring)
  File "C:\Users\fernando\Miniconda3\envs\vesseg\lib\distutils\version.py", line 137, in parse
    raise ValueError("invalid version number '%s'" % vstring)
ValueError: invalid version number '1.5.58
'

I have temporarily hacked this by replacing this line:

_version = self.version_from_command()

by:

_version = bytes('1.5.58', "utf-8")

How to replicate the behavior

Run

from nipype.interfaces import niftyreg
aladin = niftyreg.RegAladin()

Platform details:

In [1]: import nipype

In [2]: nipype.get_info()
Out[2]:
{'pkg_path': 'C:\\Users\\fernando\\Miniconda3\\envs\\vesseg\\lib\\site-packages\\nipype',
 'commit_source': 'archive substitution',
 'commit_hash': '%h',
 'nipype_version': '1.0.4',
 'sys_version': '3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]',
 'sys_executable': 'C:\\Users\\fernando\\Miniconda3\\envs\\vesseg\\python.exe',
 'sys_platform': 'win32',
 'numpy_version': '1.14.3',
 'scipy_version': '1.1.0',
 'networkx_version': '2.1',
 'nibabel_version': '2.2.1',
 'traits_version': '4.6.0'}

In [3]: nipype.__version__
Out[3]: '1.0.4'

Execution environment

I'm not sure what this means. I'm running Python from a conda environment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions