Windows
安装
Miniforge官方GitHub仓库:https://github.com/conda-forge/miniforge/releases
下载适用于Windows的最新版本安装程序(Miniforge3-Windows-x86_64.exe)
验证:conda --version
创建虚拟环境
1
| conda create -n myenv python=3.10
|
myenv 环境名称
python=3.10指定Python版本
常用命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| conda list
conda activate myenv
conda deactivate
conda env remove -n myenv
conda env export > environment.yml conda env create -f environment.yml
conda create -n new_name --clone old_name conda env remove -n old_name
|
Linux(CentOS)
1 2 3 4
| wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh chmod +x Miniforge3-Linux-x86_64.sh ./Miniforge3-Linux-x86_64.sh source ~/.bashrc
|
换源
查看当前配置:conda config --show
编辑配置:vim ~/.condarc
1 2 3 4 5 6 7 8 9 10
| channels: - defaults show_channel_urls: true default_channels: - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free - https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r custom_channels: conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
|