CNVKIT import errors
2
1
Entering edit mode
6.8 years ago
alons ▴ 270

Hi all,

I'm trying to run CNVkit (from source, in linux) after following the installation instructions on the github page but running into import errors which seem to be rare as I couldn't find any references online:

Traceback (most recent call last):
  File "cnvkit.py", line 8, in <module>
    from cnvlib import commands
  File "/home/alon/Desktop/BioinformaticsPrograms/cnvkit/cnvlib/__init__.py", line 4, in <module>
    from .cmdutil import read_cna as read
  File "/home/alon/Desktop/BioinformaticsPrograms/cnvkit/cnvlib/cmdutil.py", line 9, in <module>
    from .cnary import CopyNumArray as CNA
  File "/home/alon/Desktop/BioinformaticsPrograms/cnvkit/cnvlib/cnary.py", line 14, in <module>
    from .segmetrics import segment_mean
ImportError: No module named segmetrics

Will greatly appreciate any help!

Alon

cnvkit cnv python linux • 4.4k views
ADD COMMENT
1
Entering edit mode

Try to install using virtualenv and pip, currently (2018-01-22) PyPI hosts the same version as the GitHub repository.

ADD REPLY
1
Entering edit mode

` I have the sane error:

python ../cnvkit.py import-picard picard/p2-20_5.antitargetcoverage.csv picard/p2-20_5.targetcoverage.csv picard/p2-5_5.antitargetcoverage.csv picard/p2-5_5.targetcoverage.csv picard/p2-9_5.antitargetcoverage.csv picard/p2-9_5.targetcoverage.csv -d build/
Traceback (most recent call last):
  File "../cnvkit.py", line 8, in <module>
    from cnvlib import commands
  File "/Users/rashinaresh/cnvkit/cnvlib/__init__.py", line 4, in <module>
    from .cmdutil import read_cna as read
  File "/Users/rashinaresh/cnvkit/cnvlib/cmdutil.py", line 9, in <module>
    from .cnary import CopyNumArray as CNA
  File "/Users/rashinaresh/cnvkit/cnvlib/cnary.py", line 14, in <module>
    from .segmetrics import segment_mean
ModuleNotFoundError: No module named 'cnvlib.segmetrics'
make: *** [build/reference-picard.cnn] Error 1 `
ADD REPLY
1
Entering edit mode

Having the same issue as you both. Please post solution if anyone of you figure it out (I will as well).

ADD REPLY
0
Entering edit mode

hi all i am having similar errors with installation of cnvkit (for mac)...and cannot seem to figure it out...would anyone kindly please help?

base) torunp01@LEVIND19-I27R5K test % make
python3 ../cnvkit.py import-picard picard/p2-20_5.antitargetcoverage.csv picard/p2-20_5.targetcoverage.csv picard/p2-5_5.antitargetcoverage.csv picard/p2-5_5.targetcoverage.csv picard/p2-9_5.antitargetcoverage.csv picard/p2-9_5.targetcoverage.csv -d build/
Traceback (most recent call last):
  File "../cnvkit.py", line 4, in <module>
    from cnvlib import commands
  File "/Users/torunp01/opt/miniconda3/gatk/cnvkit/cnvlib/__init__.py", line 1, in <module>
    from skgenome.tabio import write
  File "/Users/torunp01/opt/miniconda3/gatk/cnvkit/skgenome/__init__.py", line 1, in <module>
    from . import tabio
  File "/Users/torunp01/opt/miniconda3/gatk/cnvkit/skgenome/tabio/__init__.py", line 10, in <module>
    import pandas as pd
ModuleNotFoundError: No module named 'pandas'
make: *** [build/reference-picard.cnn] Error 1
ADD REPLY
1
Entering edit mode

Please use conda to do the installation. A basic tutorial is available here to use conda (use the part for conda): Creating workflows with snakemake and conda

ADD REPLY
2
Entering edit mode
6.8 years ago
Eric T. ★ 2.8k

This is fixed now. Sorry for the trouble, I forgot to check in a new file while refactoring.

ADD COMMENT
0
Entering edit mode

Great! Thank you. Seems to be working now, running it.

ADD REPLY
2
Entering edit mode
6.8 years ago

Try the installation with conda. That's likely to solve many of your installation-related issues for many tools.

ADD COMMENT
1
Entering edit mode

After removing all of the cnvkit files associated with the download via pip, I installed conda and used conda to get the cnvkit.py script which then worked fine. Seems that ONLY the conda method of installation works properly.

Thank you for the suggestion WouterDeCoster

ADD REPLY
1
Entering edit mode

Conda is going to change how you do your installations. Always try conda first, rather than building stuff manually.

I have moved my comment so you can mark is as 'accepted' and mark this question as solved.

ADD REPLY
0
Entering edit mode

I would but I think the developer of CNVkit (Eric T.) would want to see this first, get his input on it, might be a potential bug. He's pretty active in this forum.

ADD REPLY

Login before adding your answer.

Traffic: 2710 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6