最近在入门生信,找了一个网上的ATAC-seq项目来学习入门(https://zhuanlan.zhihu.com/p/166496466),遇到在conda的虚拟环境或base环境下无法安装intervene的问题,记录下解决方案。
1.改换成pip install intervene安装;
pip install intervene
单独下载pybedtools
刚才的pip下载不是完全顺利的,会出现pybedtools失败问题
下载相关依赖报错ERROR: Failed cleaning build dir for pybedtools,则此时重新单独安装pybedtools,命令为
conda install --channel conda-forge --channel bioconda pybedtools
安装成功后,再使用conda install -c bioconda intervene命令就可以正常安装intervene了.
修改包源码解决调用Iterable的问题
安装好后用 intervene --version 测试一下是否安装成功,但是又报错:
ImportError: cannot import name ‘Iterable’ from ‘collections’
这是因为Python在3.1版本后从collections调用Iterable改成了从collections.abc,所以根据报错文件路径找到对应py文件
File “/home/me/Anaconda3/envs/atac_test/lib/python3.10/site-packages/intervene/modules/venn/list_venn.py”, line 6, in
最后 cd 到这个 list_venn.py 文件,输入命令
vim list_venn.py
进入编辑模式,把from collections import Iterable改成 from collections.abc import Iterable 即可,然后测试intervene --version ,安装成功。