1、安装conda
yum install conda -y
2、创建虚拟环境(版本自己指定)
conda create -n test python=3.8
3、激活虚拟环境
conda activate test
4、退出虚拟环境
conda deactivate
5、删除虚拟环境(二选一)
conda env remove -n test
conda remove -n test --all
6、在虚拟环境中查看、安装和卸载包
查看:conda list
安装:conda install "PKG"
卸载:conda uninstall "PKG"
注意:在以上conda命令需要一下命令行中执行,否则会报错:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershellSee 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
只需要输入bash命令之后就会在前面出现(base)
此时就可以正常操作以上conda的命令