Anaconda虚拟环境管理命令

查看所有的虚拟环境

conda env list

创建虚拟环境并指定python版本

conda create -n your_env_name python=x.x.x

激活某个虚拟环境

conda activate env_name

创建虚拟环境并指定python版本

conda create -n your_env_name python=x.x.x

改变已有虚拟环境的python版本

conda install python=版本号

删除虚拟环境

conda remove -n your_env_name --all

在虚拟环境中安装额外的包

conda install -n your_env_name package_name
或者pip install -n your_env_name package_name
如果当前已经激活了某个虚拟环境,则可以不加-n your_name

查看虚拟环境中已安装的包

conda list 或者 pip list

安装python包时换源加速

pip install package_name -i https://pypi.tuna.tsinghua.edu.cn/simple

参考

Anaconda-用conda创建python虚拟环境

猜你喜欢

转载自blog.csdn.net/hypc9709/article/details/131056662