Skip to content

Nipype fails with new networkx (>=2.0) because of API changes #2270

Closed
@mvdoc

Description

@mvdoc

Summary

Nipype installed from scratch with miniconda from conda-forge fails because networkx changed API and Graphs are missing in_edges_iter. See NetworkX 2.0 announcement. Works fine by downgrading networkx.

Actual behavior

# python -c 'from nipype.workflows.dmri.fsl.artifacts import all_fmb_pipeline;allcorr = all_fmb_pipeline()'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/contematto/miniconda3/envs/nipype/lib/python3.6/site-packages/nipype/workflows/dmri/fsl/artifacts.py", line 72, in all_fmb_pipeline
    hmc = hmc_pipeline()
  File "/home/contematto/miniconda3/envs/nipype/lib/python3.6/site-packages/nipype/workflows/dmri/fsl/artifacts.py", line 394, in hmc_pipeline
    (insmat, outputnode, [('out', 'out_xfms')])
  File "/home/contematto/miniconda3/envs/nipype/lib/python3.6/site-packages/nipype/pipeline/engine/workflows.py", line 207, in connect
    if not destnode._check_inputs(dest):
  File "/home/contematto/miniconda3/envs/nipype/lib/python3.6/site-packages/nipype/pipeline/engine/workflows.py", line 741, in _check_inputs
    return self._has_attr(parameter, subtype='in')
  File "/home/contematto/miniconda3/envs/nipype/lib/python3.6/site-packages/nipype/pipeline/engine/workflows.py", line 712, in _has_attr
    subobject = self.inputs
  File "/home/contematto/miniconda3/envs/nipype/lib/python3.6/site-packages/nipype/pipeline/engine/workflows.py", line 356, in inputs
    return self._get_inputs()
  File "/home/contematto/miniconda3/envs/nipype/lib/python3.6/site-packages/nipype/pipeline/engine/workflows.py", line 756, in _get_inputs
    for _, _, d in self._graph.in_edges_iter(nbunch=node,
AttributeError: 'DiGraph' object has no attribute 'in_edges_iter'

How to replicate the behavior

conda create -n nipype python=3.6 scipy numpy jupyter seaborn
source activate nipype
conda install -c conda-forge nipype
python -c 'from nipype.workflows.dmri.fsl.artifacts import all_fmb_pipeline;allcorr = all_fmb_pipeline()'

Platform details:

{'pkg_path': '/home/contematto/miniconda3/envs/nipype/lib/python3.6/site-packages/nipype', 'commit_source': 'archive substitution', 'commit_hash': '%h', 'nipype_version': '0.13.1', 'sys_version': '3.6.3 |Anaconda, Inc.| (default, Oct 27 2017, 19:41:01) \n[GCC 7.2.0]', 'sys_executable': '/home/contematto/miniconda3/envs/nipype/bin/python', 'sys_platform': 'linux', 'numpy_version': '1.13.3', 'scipy_version': '0.19.1', 'networkx_version': '2.0', 'nibabel_version': '2.2.0', 'traits_version': '4.6.0'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions