当前位置: 移动技术网 > IT编程>脚本编程>Python > Conda下的python包操作 (Anaconda Prompt)

Conda下的python包操作 (Anaconda Prompt)

2020年10月12日  | 移动技术网IT编程  | 我要评论
install packages:conda install -c conda-forge ‘+ the extension package name’ (channel: conda-forge)在不同环境中安装包时,环境间的切换:conda activate ‘+a specific environment name’ # 激活一个特定的环境conda deactivate # 关闭当前环境,回到默认环境查看 python 版本:...
  • 安装某个包 / 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 

参考:
conda命令大全
痛点:Anaconda3 python第三方库批量安装

本文地址:https://blog.csdn.net/qq_35762060/article/details/108013588

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网