open2c / pairtools

Extract 3D contacts (.pairs) from sequencing alignments
MIT License
104 stars 32 forks source link

Cannot import name 'dedup_cython' from partially initialized module 'pairtools.lib' (most likely due to a circular import) #224

Closed narzouni closed 8 months ago

narzouni commented 8 months ago

Hello, I am trying to run pairtools parse, but I am getting this error:

ImportError: cannot import name 'dedup_cython' from partially initialized module 'pairtools.lib' (most likely due to a circular import)

I hope someone can give some insights on the issue and how to fix it.

I am running pairtools on a bwa aligned sam file as follows:

pairtools parse --min-mapq 40 --walks-policy 5unique --max-inter-align-gap 30 --nproc-in 8 --nproc-out 8 --chroms-path mm39.genome alignedLib1.sam > parsed.pairsam

Phlya commented 8 months ago

How did you install pairtools?..

narzouni commented 8 months ago

How did you install pairtools?..

I created a Conda environment first, and then I used conda install -c conda-forge -c bioconda pairtools

narzouni commented 8 months ago

I created another conda env and used pip3 install pairtools, but I am still getting the same error message.

Phlya commented 8 months ago

Very strange... what version of pairtools is getting installed?

narzouni commented 8 months ago

Very strange... what version of pairtools is getting installed?

It is pair tools 1.0.3 with python version 3.10.14

narzouni commented 8 months ago

Hello @Phlya , I think I solved the issue. It is an installation issue. First, I created an environment but I also had many software packages installed like bedtools, deeptools, samtools, bwa, preseq, etc. It looks like those packages together caused issues.

Then I created another env with only pairtools, but I used pip3 install. It also did not work. I think the proper way to install it with a conda env is to use conda install and not pip install. I think it is working now. Thank you so much for your attention and concern. I am thinking to close this issue, but it can be a record if someone has the same issue.

Phlya commented 8 months ago

Yes, generally conda installation is best, and a clean environment can often solve problems like this! Glad it's fixed now.