1.创建python虚拟环境

# 指定python版本为2.7,注意至少需要指定python版本或者要安装的包# 后一种情况下,自动安装最新python版本
conda create -n env_name python=2.7
# 同时安装必要的包
conda create -n env_name numpy matplotlib python=2.7

anaconda3.6创建py2.7环境并**在jupyter使用

2.**虚拟环境

activate your_env_name(虚拟环境名称)

anaconda3.6创建py2.7环境并**在jupyter使用

3.安装ipykernel

conda install ipykernel,输入y

anaconda3.6创建py2.7环境并**在jupyter使用

anaconda3.6创建py2.7环境并**在jupyter使用

4.安装py27虚拟环境的kernel

python -m ipykernel install --user

anaconda3.6创建py2.7环境并**在jupyter使用(ga:借的图,我的装过了)

5.刷新jupyter可看到python2已出现

anaconda3.6创建py2.7环境并**在jupyter使用

6.关闭、删除、虚拟环境

关闭虚拟环境(即从当前环境退出返回使用PATH环境中的默认python版本)。
deactivate env_name,也可以使用`activate root`切回root环境

移除环境
conda remove -n your_env_name(虚拟环境名称) --all, 即可删除。


删除环境中的某个包。
conda remove --name $your_env_name  $package_name 即可。

 

7.其他命令

conda -V检验是否安装以及当前conda的版本

conda list 查看安装了哪些包。
conda env list 或 conda info -e 查看当前存在哪些虚拟环境
conda update conda 检查更新当前conda

# 添加Anaconda的TUNA镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
# TUNA的help中镜像地址加有引号,需要去掉
 
# 设置搜索时显示通道地址
conda config --set show_channel_urls yes

 

参考博客:https://blog.csdn.net/anyao_/article/details/79049937

                  https://www.cnblogs.com/lemonbit/p/7096541.html

相关文章:

  • 2021-08-29
  • 2021-06-17
  • 2021-07-14
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
猜你喜欢
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-09-11
相关资源
相似解决方案