Git-bash命令

激活conda环境 istar_pyenv

source activate istar_pyenv

按照指定文件requirements.txt进行环境配置

pip install -r requirements.txt

查看python版本并更改

python --version
conda install python=3.10

windows命令行

创建环境Renv_name

conda create -n env_name python=3.8

激活环境Renv_name及其反用

conda activate Renv_name
 
conda deactivate

查看环境下的包列表

conda list

移除环境

conda remove --name env_name  package_name
 
conda remove --name env_name --all

conda命令实例

示例命令功能描述英文全称
conda create --n env_name创建一个新环境create a new environment
conda activate env_name激活一个环境activate an environment
conda deactivate停用当前激活的环境deactivate the current environment
conda env list列出所有环境list all environments
conda remove --n env_name --all删除指定环境remove the specified environment
conda install package_name安装软件包到当前环境install a package in the current environment
conda install -n env_name package_name安装软件包到指定环境install a package in the specified environment
conda list列出当前环境中的所有已安装软件包list all installed packages in the current environment
conda update package_name更新软件包到最新版本update a package to the latest version
conda update conda更新 Conda 到最新版本update Conda to the latest version
conda search package_name搜索可用软件包search for available packages
conda clean --all清理 Conda 缓存和未使用的包clean Conda cache and unused packages
conda export > environment.yml导出当前环境的配置文件export the current environment configuration to a file
conda env create -f environment.yml从配置文件创建环境create an environment from a configuration file
conda env update -f environment.yml更新环境以匹配配置文件update the environment to match the configuration file
conda remove --name env_name package_name从指定环境中移除软件包remove a package from the specified environment