conda

date
Oct 18, 2024
slug
conda
status
Published
tags
Website
python
summary
python包管理器
type
Post
  • 有关的

conda

  • 查看 conda 版本(检查是否安装):conda -V
  • 查看已经安装的第三方库:conda list
  • 安装库:conda install pkg_name
  • 删除库:conda uninstall pkg_name
  • 虚拟环境
    • 创建虚拟环境:conda create -n env_name python=x.x --yes
      • --yes 参数表示在安装过程中不需要再次确认是否要安装
    • 启动虚拟环境:conda activate env_name
    • 退出虚拟环境:conda deactivate
    • 删除虚拟环境:conda remove -n env_name --all
      • --all 参数表示删除环境中的所有包
    • 查看已经存在的虚拟环境:conda env list 或者 conda info -e
    • 进入后切换虚拟环境:activate env_name
  • 导出当前环境的包文件: conda env export > requirements.yml
  • 安装指定的包文件中的包: conda env create -f requirements.yml
对于本文内容有任何疑问, 可与我联系.