- 安装某个包 / install the specific package:
conda install -c conda-forge '+ the extension package name'
- 批量安装包 / install packages in bulk / batch:
conda install -c conda-forge '+package_1' '+package_2' ...
- 删除某个特定包
conda uninstall -c conda-forge '+ packageName'
- 查看 python 版本:
python -V
在 python 运行界面中查看 python 版本的方法:
import sys
print(sys.version)
- 查看已安装的包列表
conda list
- 查看某个包是否安装
conda list '+ package'
- channel
# 查看自己 conda 配置的channel,同时会显示优先级
conda config --get channels
# 添加新的 channel https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
# 新添加的 channel 具有最高优先级
# 设置优先级之后,可以不用 -c 来指定 channel 安装
# 添加最高优先级的 channel
conda config --prepend channels new_channel # prepend = add
# 添加最低优先级的 channel
conda config --append channels new_channel
# 移除 channel conda-forge
conda config --remove channels conda-forge
# channel_priority:strict, flexible or disable
conda config --describe channel_priority
# 不使用 channel_priority
conda config --set channel_priority false
# 设置 channel_priority
conda config --set channel_priority strict # 可能失效
# 默认conda解析软件依赖时优先考虑允许的最高版本,设置通道优先级权限高于软件版本新旧后,conda会能更快的解决依赖关系,
# 避免defaults和conda-forge通道的奇怪组合导致软件依赖解析迟迟不能将结束的问题
# Strict channel priority can dramatically speed up conda operations and also reduce package incompatibility problem