【python系列】win系统最全面的anaconda命令汇总 (持续更新)

  • 查看

1. 查看conda版本

conda -V   

  2. 查看当前虚拟环境的python版本

python -V 

  3. 查看已安装的包(当前虚拟环境)

conda list

  4.查看已安装的包(非当前虚拟环境)

conda list -n 环境名称

  5.查看包的版本

conda search 包名

  6.查看虚拟环境

conda env list

 7.查看包的位置、版本等

pip show 包名

 8.查看镜像源

Conda config –show channels
Pip config list

  • 安装包

1.当前虚拟环境安装

conda install 包名=版本

或者使用

pip install 包名=版本

#“版本”可以不写

2.指定虚拟环境安装

conda install -n 环境名称 包名=版本

或者使用

pip install -n 环境名称 包名==版本

#“版本”可以不写

3. 离线安装whl文件

pip install xxx.whl  # 需要将路径变换到文件所在路径中

4. 更新包

pip install 包名 --upgrade

  • 虚拟环境

1. 创建虚拟环境

conda create -n 环境名称 python=3.9  

#后面python=3.9是要用的python的版本号,根据实际情况填写

2. 激活虚拟环境

activate 环境名称

3. 删除虚拟环境

conda env remove -n 环境名称

  4.查看虚拟环境

conda env list

  • 镜像源

  1. 查看镜像源

Conda config –show channels
Pip config list

  2.  删除单个镜像源

conda config --remove channels 镜像源网址

   3.  删除所有镜像源

conda config --remove-key channels

   4. 添加国内镜像源(conda)

(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 --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
#设置搜索时显示通道地址
conda config --set show_channel_urls yes

(2) 中科大

conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
 #设置搜索时显示通道地址
conda config --set show_channel_urls yes

(3)上交大

conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.sjtug.sjtu.edu.cn/anaconda/cloud/conda-forge/
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes

(4)阿里

conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/free/
conda config --add channels https://mirrors.aliyun.com/anaconda/pkgs/main/
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值