conda学习贴

这是一个conda学习贴,记录了我从接触conda到解决各种问题的过程。

1.anaconda下载后安装

  1. cd 到所在路径
  2. 赋予权限:
    chmod u+x Anaconda.sh
  3. ./Anaconda.sh
  4. 创建环境:
    conda create -n XXX
  5. 激活进入:
    conda activate XXX

2.报错:Solving environment: failed with initial frozen solve. Retrying with flexible solve.

#尝试修改flexiblility

conda config --add channels conda-forge
conda config --set channel_priority flexible

#其实不管报错也可能成功安装

3.创建了一个python2的母环境,以后可以无限使用

conda create -n py2

#复制到新环境
conda create -n newenv --clone py2
#如果需要可以删除旧环境
conda remove -n oldenv --all

4.安装软件包

#一般来说
conda install pgname 
#或者
conda install -c bioconda pgname
#如果安装过程过于缓慢,可以先找到包的路径
#参考:[Anaconda找包](https://blog.csdn.net/Erice_s/article/details/80156191)
#以biopython为例
anaconda search -t conda biopython
anaconda show anaconda/biopython
conda install --channel https://conda.anaconda.org/anaconda biopython

ADD.如果想要离线下载

nohup conda install -y software &

ADD. 在镜像中下载安装包并离线安装

#将下载好的安装包拷贝到~/Anaconda3/pkgs/
conda install --use-local software.gz

猜你喜欢

转载自blog.csdn.net/mushroom234/article/details/110308448