搭建Python jupyter环境

搭建Python jupyter环境

在安装 Python Jupyter环境之前需要先安装Python环境

如果是简单的使用不需要那么多配置:

1.安装:pip install jupyter

2.启动:jupyter notebook

下面是详细的配置(下面的我没做过,我用的就是上面简单的)

1.安装Python2和Python3环境,并安装 virtualvenv.

2.安装配置Jupyter

  • 使用python3 pip安装jupyter
    pip install jupyter
    搭建Python jupyter环境

  • 生成 jupyter配制文件
    jupyter notebook --generate-config
    搭建Python jupyter环境

  • 生成一个密码hash
    搭建Python jupyter环境

  • 编辑/home/yang/.jupyter/jupyter_notebook_config.py配制文件
    搭建Python jupyter环境

  • 启动 Jupyter
    搭建Python jupyter环境

启动成功,可直接使用浏览器访问。这里我们已经配制了域名,可以使用域名访问:(也可直接输入IP + 端口访问)
搭建Python jupyter环境
输入我们之前用以生成hash的密码,登录成功后如下图:
搭建Python jupyter环境

搭建Python jupyter环境

3.让Jupyter同时支持 python2和python3

切换到root用户,执行 ipython kernelspec install-selfipython2 kernelspec install-self为Jupyter添加 python2和python3的 kernel支持

搭建Python jupyter环境

4.将 jupyter添加到Linux系统服务中

搭建Python jupyter环境

5.给 jupyter前端添加NGINX代理

搭建Python jupyter环境

最终效果:

搭建Python jupyter环境