etal / cnvkit

Copy number variant detection from targeted DNA sequencing
http://cnvkit.readthedocs.org
Other
547 stars 165 forks source link

Bump networkx dependency to 2.5 #606

Closed auberginekenobi closed 3 years ago

auberginekenobi commented 3 years ago

Python 3.9 fractions.py is deprecated, making networkx 2.3 raise error attached at bottom. Solved in https://github.com/smicallef/spiderfoot/issues/1124 by bumping networkx version to minimum 2.5.

Traceback (most recent call last):
  File "/home/ochapman/miniconda3/envs/cnvkit/bin/cnvkit.py", line 4, in <module>
    from cnvlib import commands
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/cnvlib/__init__.py", line 5, in <module>
    from .commands import *
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/cnvlib/commands.py", line 34, in <module>
    from . import (access, antitarget, autobin, batch, bintest, call, core,
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/cnvlib/batch.py", line 8, in <module>
    from . import (access, antitarget, autobin, bintest, call, core, coverage,
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/cnvlib/segmentation/__init__.py", line 17, in <module>
    from . import cbs, flasso, haar, hmm, none
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/cnvlib/segmentation/hmm.py", line 11, in <module>
    import pomegranate as pom
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/pomegranate/__init__.py", line 12, in <module>
    from .parallel import *
  File "pomegranate/parallel.pyx", line 7, in init pomegranate.parallel
  File "pomegranate/hmm.pyx", line 13, in init pomegranate.hmm
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/networkx/__init__.py", line 114, in <module>
    import networkx.generators
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/networkx/generators/__init__.py", line 14, in <module>
    from networkx.generators.intersection import *
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/networkx/generators/intersection.py", line 13, in <module>
    from networkx.algorithms import bipartite
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/networkx/algorithms/__init__.py", line 16, in <module>
    from networkx.algorithms.dag import *
  File "/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/site-packages/networkx/algorithms/dag.py", line 23, in <module>
    from fractions import gcd
ImportError: cannot import name 'gcd' from 'fractions' (/home/ochapman/miniconda3/envs/cnvkit/lib/python3.9/fractions.py)
tskir commented 3 years ago

Hi @auberginekenobi! Thank you for reporting this. This appears to be a transitive dependency problem in the pomegranate library, so I reported it to them.

In the meanwhile, to ensure that CNVkit installs and runs correctly under Python 3.9 (although it's worth pointing out that we don't officially support 3.9 yet), I've submitted a PR to bump NetworkX version, as you suggested.