問題
Python通過pip安裝PyVCF成功,但運行腳本時出現(xiàn)問題:
File "/home/theo/anaconda3/lib/python3.9/site-packages/vcftoolz/vcftoolz.py", line 19, in <module>
import vcf
File "/home/theo/anaconda3/lib/python3.9/site-packages/vcf/__init__.py", line 166, in <module>
from parser import Reader, Writer
ImportError: cannot import name 'Reader' from 'parser' (/home/theo/anaconda3/lib/python3.9/lib-dynload/parser.cpython-39-x86_64-linux-gnu.so)
解決
使用conda重新安裝:
conda install --channel "conda-forge" pyvcf
Ref:https://github.com/CFSAN-Biostatistics/vcftoolz/issues/9