conda操作汇总


指定清华源:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple

conda 环境迁移

环境迁移

pip install conda-pack
conda pack -n attnGAN
到/home/conggaoxiang/anaconda3/envs下:
mkdir attnGAN
tar -xzvf attnGAN.tar.gz -C /home/conggaoxiang/anaconda3/envs/attnGAN
conda info -e

成功!

如何复制一个conda环境

首先找到要复制的环境的路径:conda info --env

然后利用克隆命令复制到你要配的账户:conda create -n name --clone path

conda查看Python环境

conda info --env

创建Python环境

  • 创建
conda create --name python35 python=3.5 

代表创建一个python3.5的环境,我们把它命名为python35

  • 删除
conda remove -n python35 --all
  • 使用

conada activate xx

附录

配置pc3的heco:
首先,这个不好查cuda的版本,查出来是10.0,其实是10.1。
设置清华源:

  conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
  conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
  conda config --set show_channel_urls yes
  conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/

在torch官网上找命令:(安装的是指定版本pytorch,会自动选择python版本并安装)
conda install pytorch==1.7.0 cudatoolkit=10.1
记住去掉-c pytorch。

posted @ 2021-01-30 15:22  zae  阅读(77)  评论(0编辑  收藏  举报