jupyter配置虚拟环境

        jupyter是anaconda自带的web版python代码编辑器,用来调试很方便。在开发过程中可能由于每个项目用的库版本或者Python版本不同,需要创建虚拟环境,本文介绍怎样在Jupyter中配置虚拟环境。

1、在主环境执行 conda install nb_conda。

2、后台启动Jupyter
      nohup jupyter notebook --ip=x.x.x.x --port=8889 --allow-root > nohup.log 2>&1 &

3、创建虚拟环境
      conda create --name py2 python=2.7

4、进入虚拟环境
      source activate py2

5、执行 conda install nb_conda 。

6、退出虚拟环境

      source deactivate

在Jupyter中点击New即可看到所建的虚拟环境。

猜你喜欢

转载自blog.csdn.net/haveanybody/article/details/86482172