genomeview icon indicating copy to clipboard operation
genomeview copied to clipboard

Cannot import MismatchCounts

Open ghost opened this issue 5 years ago • 2 comments

I created a new conda env for the genomeview module. And when I try to import genomeview, an ImportError happens:

''' ERROR:root:Unable to load cythonized quickconsensus module; this is likely because pysam has been updated since genomeview was originally install. To fix this, force reinstall genomeview: pip install --upgrade --force-reinstall genomeview

ImportError Traceback (most recent call last) in ----> 1 import genomeview 2 from genomeview.bamtrack import SingleEndBAMTrack, PairedEndBAMTrack 3 import genomeview.axis 4 import genomeview.graphtrack 5 from genomeview import genomesource

~/anaconda3/envs/bamvis/lib/python3.8/site-packages/genomeview/init.py in 22 from genomeview.axis import * 23 from genomeview.track import * ---> 24 from genomeview.bamtrack import * 25 from genomeview.bedtrack import BEDTrack 26 from genomeview.graphtrack import *

~/anaconda3/envs/bamvis/lib/python3.8/site-packages/genomeview/bamtrack.py in 4 from genomeview.track import Track 5 from genomeview.intervaltrack import Interval, IntervalTrack ----> 6 from genomeview import MismatchCounts 7 from genomeview.utilities import match_chrom_format 8

ImportError: cannot import name 'MismatchCounts' from partially initialized module 'genomeview' (most likely due to a circular import) (/Users/skyxt/anaconda3/envs/bamvis/lib/python3.8/site-packages/genomeview/init.py) ''' I read about the same issue reported by others and nspies provided this solution:

This is almost certainly caused by an error during installation. I would try to uninstall genomeview and then reinstall it, making sure that you have pysam and cython installed prior to installation.

There is a fall-back, non-cythonized version that should get loaded; I'm not sure why it isn't in your case. Are you getting any warning messages or other output when running those commands?

Originally posted by @nspies in https://github.com/nspies/genomeview/issues/8#issuecomment-404547733

This seems to work for the original issue poster but I still face the same error after reinstalling cython with conda. Even reinstalling genomeview won't change anything.

Pls enlighten me on how to solve this. Really looking forward to use this package for automated visualization.

ghost avatar Feb 21 '20 10:02 ghost

I resolved the import error by installing from github:

pip install -U git+https://github.com/nspies/genomeview.git

danledinh avatar Oct 08 '20 17:10 danledinh

Would be greate to merge this on pypi quickly !

dridk avatar Jan 31 '21 15:01 dridk

closed by #32

nspies avatar Aug 11 '23 02:08 nspies