一、環(huán)境
linux-ubuntu
anaconda3/miniconda
二、實操演示
1.conda是安裝QIIME2的首選工具,但是很多國內(nèi)的朋友苦于無法鏈接網(wǎng)絡(luò)問題導致無法安裝。
??該教程的精髓放在開頭:conda安裝qiime2出問題,國內(nèi)網(wǎng)友的普遍問題是.yml文件中的鏡像源沒修改對,目前網(wǎng)上的大部分教程只修改了conda-forge和bioconda的鏡像源,卻沒有更換qiime2鏡像源,這里給大家介紹一下,qiime2也是存在鏡像源的,它便是來自清華的鏡像源,只要將他們的鏡像源都進行更換,則可以輕松解決conda安裝qiime2的問題。
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/qiime2
??網(wǎng)上的教程各種各樣,但真正有效的幾乎沒有,像刪除q2后續(xù)再單獨下載的方法無法解決環(huán)境依賴的問題,也十分繁瑣,令人生厭。這里我將以最新版的qiime2-2021.11為例子來向大家演示如何使用conda成功對qiime2-2021.11進行安裝。(步驟與QIIME2官網(wǎng)教程類似,但結(jié)合國內(nèi)無法翻墻下載的普遍情況)
1.1 運行如下代碼下載.yml文件
wget https://data.qiime2.org/distro/core/qiime2-2021.11-py38-linux-conda.yml
??很多人這一步就進行不下去,顯示與下圖類似的網(wǎng)絡(luò)報錯問題,那么繼續(xù)往下看,相信你的問題一定會得到解決。
如果你的問題是可以下載.yml文檔但是仍無法用conda安裝qiime2,請轉(zhuǎn)至1.5部分,相信你的問題一定會得到解決。

??為了輔助大家理解,這里我說一下,上面的這條wget命令本質(zhì)上只是從QIIME2官網(wǎng)下載.yml格式的一個安裝包的目錄,以方便我們下一條conda命令去下載安裝.yml文件中羅列的包,大部分我們運行這條命令報錯的原因都是無法訪問外網(wǎng),鏈接無效,你們可以把網(wǎng)址復制到瀏覽器驗證一下,大概率是打不開頁面的。這時候我們其實也不需要翻墻去科學上網(wǎng),只需要手動下載這個.yml文件然后把它放到我們Ubuntu系統(tǒng)對應的工作目錄中即可。這里我把最新版的.yml放在文末附錄部分,大家可以粘貼到文本文檔然后把.txt后綴改為.yml放到你的Ubuntu系統(tǒng)對應的目錄中即可接著往下進行。
1.2 .yml文件放置到對應位置后,執(zhí)行下面的命令開始安裝QIIME2環(huán)境。
友情提醒:請先保證自己有足夠的內(nèi)存和良好的網(wǎng)絡(luò),安裝所需要的時間由電腦配置與網(wǎng)速共同決定
conda env create -n qiime2-2021.11 --file qiime2-2021.11-py38-linux-conda.yml
輸入命令后,出現(xiàn)如下圖所示信息,則恭喜你,等待安裝成功即可


1.3最后運行代碼,刪了這個.yml文件即可
rm qiime2-2021.11-py38-linux-conda.yml
1.4 激活qiime2并查看幫助文檔以驗證是否安裝成功
conda activate qiime2-2021.11
qiime --help

1.5 修改你下載好的.yml文件的鏡像源
具體操作如下
將.yml文件打開后修改channels部分
原內(nèi)容
channels:
- qiime2/label/r2021.11
- conda-forge
- bioconda
- defaults
修改為:
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/qiime2
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
- defaults
再次運行如下命令即可
conda env create -n qiime2-2021.11 --file qiime2-2021.11-py38-linux-conda.yml
如果大家覺得有用,歡迎大家點贊并關(guān)注我,我是R語言_茶味先生,后續(xù)我會更新更多關(guān)于qiime2的心得體會,歡迎大家交流討論。原創(chuàng)不易,引用請注明出處,謝謝!
三、附錄
2021.11版本的.yml 文件內(nèi)容
channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/qiime2
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
- defaults
dependencies:
- _libgcc_mutex=0.1
- _openmp_mutex=4.5
- _r-mutex=1.0.1
- alsa-lib=1.2.3
- argcomplete=1.12.3
- argon2-cffi=21.1.0
- async_generator=1.10
- attrs=21.2.0
- backcall=0.2.0
- backports=1.0
- backports.functools_lru_cache=1.6.4
- bibtexparser=1.1.0
- binutils_impl_linux-64=2.36.1
- binutils_linux-64=2.36
- bioconductor-biobase=2.50.0
- bioconductor-biocgenerics=0.36.0
- bioconductor-biocparallel=1.24.1
- bioconductor-biostrings=2.58.0
- bioconductor-dada2=1.18.0
- bioconductor-delayedarray=0.16.3
- bioconductor-genomeinfodb=1.26.4
- bioconductor-genomeinfodbdata=1.2.4
- bioconductor-genomicalignments=1.26.0
- bioconductor-genomicranges=1.42.0
- bioconductor-iranges=2.24.1
- bioconductor-matrixgenerics=1.2.1
- bioconductor-rhtslib=1.22.0
- bioconductor-rsamtools=2.6.0
- bioconductor-s4vectors=0.28.1
- bioconductor-shortread=1.48.0
- bioconductor-summarizedexperiment=1.20.0
- bioconductor-xvector=0.30.0
- bioconductor-zlibbioc=1.36.0
- biom-format=2.1.10
- blast=2.12.0
- bleach=4.1.0
- bokeh=2.4.2
- bowtie2=2.4.2
- brotli=1.0.9
- brotli-bin=1.0.9
- brotlipy=0.7.0
- bwidget=1.9.14
- bzip2=1.0.8
- c-ares=1.18.1
- ca-certificates=2021.10.8
- cachecontrol=0.12.10
- cached-property=1.5.2
- cached_property=1.5.2
- cairo=1.16.0
- certifi=2021.10.8
- cffi=1.15.0
- chardet=4.0.0
- click=7.1.2
- colorama=0.4.4
- cryptography=35.0.0
- curl=7.80.0
- cutadapt=3.5
- cycler=0.11.0
- cython=0.29.24
- dbus=1.13.6
- deblur=1.1.0
- debugpy=1.5.1
- decorator=4.4.2
- defusedxml=0.7.1
- dendropy=4.5.2
- dill=0.3.4
- dnaio=0.6.0
- emperor=1.0.3
- entrez-direct=16.2
- entrypoints=0.3
- expat=2.4.1
- fastcluster=1.1.26
- fasttree=2.1.10
- font-ttf-dejavu-sans-mono=2.37
- font-ttf-inconsolata=3.000
- font-ttf-source-code-pro=2.038
- font-ttf-ubuntu=0.83
- fontconfig=2.13.1
- fonts-conda-ecosystem=1
- fonts-conda-forge=1
- fonttools=4.28.1
- freetype=2.10.4
- fribidi=1.0.10
- future=0.18.2
- gcc_impl_linux-64=9.4.0
- gcc_linux-64=9.4.0
- gettext=0.19.8.1
- gfortran_impl_linux-64=9.4.0
- gfortran_linux-64=9.4.0
- glib=2.70.1
- glib-tools=2.70.1
- gneiss=0.4.6
- graphite2=1.3.13
- gsl=2.7
- gst-plugins-base=1.18.5
- gstreamer=1.18.5
- gxx_impl_linux-64=9.4.0
- gxx_linux-64=9.4.0
- h5py=3.3.0
- harfbuzz=3.1.1
- hdf5=1.10.6
- hdmedians=0.14.2
- hmmer=3.1b2
- htslib=1.14
- icu=68.2
- idna=2.10
- ijson=3.1.3
- importlib-metadata=4.8.2
- importlib_metadata=4.8.2
- importlib_resources=5.4.0
- iniconfig=1.1.1
- ipykernel=6.5.0
- ipython=7.29.0
- ipython_genutils=0.2.0
- ipywidgets=7.6.5
- iqtree=2.1.4_beta
- isa-l=2.30.0
- jbig=2.1
- jedi=0.18.1
- jinja2=3.0.3
- joblib=1.1.0
- jpeg=9d
- jq=1.6
- jsonschema=4.2.1
- jupyter_client=7.1.0
- jupyter_core=4.9.1
- jupyterlab_pygments=0.1.2
- jupyterlab_widgets=1.0.2
- kernel-headers_linux-64=2.6.32
- kiwisolver=1.3.2
- krb5=1.19.2
- lcms2=2.12
- ld_impl_linux-64=2.36.1
- lerc=2.2.1
- libblas=3.9.0
- libbrotlicommon=1.0.9
- libbrotlidec=1.0.9
- libbrotlienc=1.0.9
- libcblas=3.9.0
- libclang=11.1.0
- libcurl=7.80.0
- libdeflate=1.7
- libedit=3.1.20191231
- libev=4.33
- libevent=2.1.10
- libffi=3.4.2
- libgcc=7.2.0
- libgcc-devel_linux-64=9.4.0
- libgcc-ng=11.2.0
- libgfortran-ng=11.2.0
- libgfortran5=11.2.0
- libglib=2.70.1
- libgomp=11.2.0
- libiconv=1.16
- liblapack=3.9.0
- libllvm10=10.0.1
- libllvm11=11.1.0
- libnghttp2=1.43.0
- libnsl=2.0.0
- libogg=1.3.4
- libopenblas=0.3.18
- libopus=1.3.1
- libpng=1.6.37
- libpq=13.5
- libsanitizer=9.4.0
- libsodium=1.0.18
- libssh2=1.10.0
- libstdcxx-devel_linux-64=9.4.0
- libstdcxx-ng=11.2.0
- libtiff=4.3.0
- libuuid=2.32.1
- libuv=1.42.0
- libvorbis=1.3.7
- libwebp-base=1.2.1
- libxcb=1.13
- libxkbcommon=1.0.3
- libxml2=2.9.12
- libxslt=1.1.33
- libzlib=1.2.11
- llvmlite=0.36.0
- lockfile=0.12.2
- lxml=4.6.4
- lz4=3.1.3
- lz4-c=1.9.3
- mafft=7.490
- make=4.3
- markupsafe=2.0.1
- matplotlib=3.5.0
- matplotlib-base=3.5.0
- matplotlib-inline=0.1.3
- mistune=0.8.4
- more-itertools=8.11.0
- msgpack-python=1.0.2
- munkres=1.1.4
- mysql-common=8.0.27
- mysql-libs=8.0.27
- natsort=8.0.0
- nbclient=0.5.9
- nbconvert=6.3.0
- nbformat=5.1.3
- ncurses=6.2
- nest-asyncio=1.5.1
- networkx=2.6.3
- nodejs=16.12.0
- nose=1.3.7
- notebook=6.4.6
- nspr=4.32
- nss=3.72
- numba=0.53.1
- numpy=1.21.4
- olefile=0.46
- oniguruma=6.9.7.1
- openjdk=11.0.1
- openjpeg=2.4.0
- openssl=1.1.1l
- packaging=21.3
- pandas=1.2.5
- pandoc=2.16.2
- pandocfilters=1.5.0
- pango=1.48.10
- parso=0.8.2
- patsy=0.5.2
- pbzip2=1.1.13
- pcre=8.45
- pcre2=10.37
- perl=5.26.2
- perl-archive-tar=2.18
- perl-carp=1.38
- perl-common-sense=3.74
- perl-compress-raw-bzip2=2.087
- perl-compress-raw-zlib=2.087
- perl-exporter=5.72
- perl-exporter-tiny=1.002001
- perl-extutils-makemaker=7.36
- perl-io-compress=2.087
- perl-io-zlib=1.10
- perl-json=4.02
- perl-json-xs=2.34
- perl-list-moreutils=0.413
- perl-pathtools=3.75
- perl-scalar-list-utils=1.52
- perl-threaded=5.26.0
- perl-types-serialiser=1.0
- pexpect=4.8.0
- pickleshare=0.7.5
- pigz=2.6
- pillow=8.4.0
- pip=21.3.1
- pixman=0.40.0
- pluggy=1.0.0
- prometheus_client=0.12.0
- prompt-toolkit=3.0.22
- psutil=5.8.0
- pthread-stubs=0.4
- ptyprocess=0.7.0
- py=1.11.0
- pycparser=2.21
- pygments=2.10.0
- pynndescent=0.5.5
- pyopenssl=21.0.0
- pyparsing=3.0.6
- pyqt=5.12.3
- pyqt-impl=5.12.3
- pyqt5-sip=4.19.18
- pyqtchart=5.12
- pyqtwebengine=5.12.1
- pyrsistent=0.18.0
- pysocks=1.7.1
- pytest=6.2.5
- python=3.8.12
- python-dateutil=2.8.2
- python-isal=0.11.1
- python_abi=3.8
- pytz=2021.3
- pyyaml=6.0
- pyzmq=22.3.0
- q2-alignment=2021.11.0
- q2-composition=2021.11.0
- q2-cutadapt=2021.11.0
- q2-dada2=2021.11.0
- q2-deblur=2021.11.0
- q2-demux=2021.11.0
- q2-diversity=2021.11.0
- q2-diversity-lib=2021.11.0
- q2-emperor=2021.11.0
- q2-feature-classifier=2021.11.0
- q2-feature-table=2021.11.0
- q2-fragment-insertion=2021.11.0
- q2-gneiss=2021.11.0
- q2-longitudinal=2021.11.0
- q2-metadata=2021.11.0
- q2-mystery-stew=2021.11.0
- q2-phylogeny=2021.11.0
- q2-quality-control=2021.11.0
- q2-quality-filter=2021.11.0
- q2-sample-classifier=2021.11.0
- q2-taxa=2021.11.0
- q2-types=2021.11.0
- q2-vsearch=2021.11.0
- q2cli=2021.11.0
- q2galaxy=2021.11.0
- q2templates=2021.11.0
- qiime2=2021.11.0
- qt=5.12.9
- r-assertthat=0.2.1
- r-backports=1.3.0
- r-base=4.0.5
- r-bh=1.75.0_0
- r-bitops=1.0_7
- r-brio=1.1.2
- r-callr=3.7.0
- r-cli=3.1.0
- r-cluster=2.1.2
- r-colorspace=2.0_2
- r-crayon=1.4.2
- r-desc=1.4.0
- r-diffobj=0.3.5
- r-digest=0.6.28
- r-ellipsis=0.3.2
- r-evaluate=0.14
- r-fansi=0.5.0
- r-farver=2.1.0
- r-formatr=1.11
- r-futile.logger=1.4.3
- r-futile.options=1.0.1
- r-ggplot2=3.3.5
- r-glue=1.5.0
- r-gtable=0.3.0
- r-hwriter=1.3.2
- r-isoband=0.2.5
- r-jpeg=0.1_9
- r-jsonlite=1.7.2
- r-labeling=0.4.2
- r-lambda.r=1.2.4
- r-lattice=0.20_45
- r-latticeextra=0.6_29
- r-lifecycle=1.0.1
- r-magrittr=2.0.1
- r-mass=7.3_54
- r-matrix=1.3_2
- r-matrixstats=0.61.0
- r-mgcv=1.8_38
- r-munsell=0.5.0
- r-nlme=3.1_153
- r-permute=0.9_5
- r-pillar=1.6.4
- r-pkgconfig=2.0.3
- r-pkgload=1.2.3
- r-plyr=1.8.6
- r-png=0.1_7
- r-praise=1.0.0
- r-processx=3.5.2
- r-ps=1.6.0
- r-r6=2.5.1
- r-rcolorbrewer=1.1_2
- r-rcpp=1.0.7
- r-rcppparallel=5.1.4
- r-rcurl=1.98_1.5
- r-rematch2=2.1.2
- r-reshape2=1.4.4
- r-rlang=0.4.12
- r-rprojroot=2.0.2
- r-rstudioapi=0.13
- r-scales=1.1.1
- r-snow=0.4_4
- r-stringi=1.7.5
- r-stringr=1.4.0
- r-testthat=3.1.0
- r-tibble=3.1.6
- r-utf8=1.2.2
- r-vctrs=0.3.8
- r-vegan=2.5_7
- r-viridislite=0.4.0
- r-waldo=0.3.1
- r-withr=2.4.2
- raxml=8.2.12
- readline=8.1
- requests=2.25.1
- samtools=1.14
- scikit-bio=0.5.6
- scikit-learn=0.24.1
- scipy=1.7.2
- seaborn=0.11.2
- seaborn-base=0.11.2
- sed=4.8
- send2trash=1.8.0
- sepp=4.3.10
- setuptools=59.2.0
- six=1.16.0
- sortmerna=2.0
- sqlite=3.36.0
- statsmodels=0.13.1
- sysroot_linux-64=2.12
- tbb=2020.2
- terminado=0.12.1
- testpath=0.5.0
- threadpoolctl=3.0.0
- tk=8.6.11
- tktable=2.10
- toml=0.10.2
- tornado=6.1
- tqdm=4.62.3
- traitlets=5.1.1
- typing_extensions=4.0.0
- tzlocal=2.1
- umap-learn=0.5.2
- unicodedata2=13.0.0.post2
- unifrac=0.20.2
- urllib3=1.26.7
- vsearch=2.7.0
- wcwidth=0.2.5
- webencodings=0.5.1
- wheel=0.37.0
- widgetsnbextension=3.5.2
- xmltodict=0.12.0
- xopen=1.2.1
- xorg-kbproto=1.0.7
- xorg-libice=1.0.10
- xorg-libsm=1.2.3
- xorg-libx11=1.7.2
- xorg-libxau=1.0.9
- xorg-libxdmcp=1.1.3
- xorg-libxext=1.3.4
- xorg-libxrender=0.9.10
- xorg-libxt=1.2.1
- xorg-renderproto=0.11.1
- xorg-xextproto=7.3.0
- xorg-xproto=7.0.31
- xz=5.2.5
- yaml=0.2.5
- yq=2.12.2
- zeromq=4.3.4
- zipp=3.6.0
- zlib=1.2.11
- zstd=1.5.0