conda使用手册
conda介绍
conda是一个适用于多种语言的包、依赖项和环境管理系统(Python、R、Ruby、Lua、Scala、Java、JavaScript、C/C++、FORTRAN)
Conda 可以快速安装、运行和更新软件包及其依赖项。 Conda 可以轻松地在本地计算机上创建、保存、加载环境并在环境之间切换。 一开始是为 Python 程序创建的,但也可以打包和分发其他语言的软件。如果你需要一个需要不同版本Python的包,不需要切换到不同的环境管理器,因为conda也是一个环境管理器。 只需几个命令,您就可以设置一个完全独立的环境来运行不同版本的 Python,同时继续在正常环境中运行常用版本的 Python。
conda有Anaconda 和 Miniconda两个版本。
Miniconda 是 conda 的免费最小安装程序。 它是 Anaconda 的一个小型引导版本,仅包含 conda、Python、它们都依赖的包以及少量其他有用的包(例如 pip、zlib 等)。 如果需要更多软件包,需要使用 conda install
命令从 Anaconda 公共存储库或其他渠道(例如 conda-forge 或 bioconda)默认提供的数千个软件包中进行安装。
参考资料
官网: https://www.anaconda.com/
miniconda安装:https://docs.conda.io/en/latest/miniconda.html
如何在conda中删除环境 https://www.python100.com/html/6F19GKG4SB48.html
conda环境切换 https://zhuanlan.zhihu.com/p/583034130
Anaconda与conda、pip与conda的区别 https://zhuanlan.zhihu.com/p/379321816
一文全面掌握conda https://blog.csdn.net/coder_oldgeek/article/details/122239755
安装
These four commands quickly and quietly install the latest 64-bit version of the installer and then clean up after themselves. To install a different version or architecture of Miniconda for Linux, change the name of the .sh installer in the wget command.
mkdir -p ~/miniconda3 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3 rm -rf ~/miniconda3/miniconda.sh
After installing, initialize your newly-installed Miniconda. The following commands initialize for bash and zsh shells:
~/miniconda3/bin/conda init bash ~/miniconda3/bin/conda init zsh
常用命令
conda env list
新建虚拟环境,如my_env
conda create -n my_env python=3.8
切换到想要的虚拟环境,如my_env
conda activate my_env
删除虚拟环境
conda env remove --name my_env
命令列表
conda is a tool for managing and deploying applications, environments and packages. Options: positional arguments: command clean Remove unused packages and caches. config Modify configuration values in .condarc. This is modeled after the git config command. Writes to the user .condarc file (/root/.condarc) by default. create Create a new conda environment from a list of specified packages. help Displays a list of available conda commands and their help strings. info Display information about current conda install. init Initialize conda for shell interaction. [Experimental] install Installs a list of packages into a specified conda environment. list List linked packages in a conda environment. package Low-level conda package utility. (EXPERIMENTAL) remove Remove a list of packages from a specified conda environment. uninstall Alias for conda remove. run Run an executable in a conda environment. [Experimental] search Search for packages and display associated information. The input is a MatchSpec, a query language for conda packages. See examples below. update Updates conda packages to the latest compatible version. upgrade Alias for conda update. optional arguments: -h, --help Show this help message and exit. -V, --version Show the conda version number and exit. conda commands available from other packages: env
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步