美文网首页
在 Centos7 上搭建 Jupyter Notebook 环

在 Centos7 上搭建 Jupyter Notebook 环

作者: JinkeyAI | 来源:发表于2017-11-27 23:42 被阅读182次

    为了远程跑起一本书的 notebook, 有了以下的故事
    https://github.com/nfmcclure/tensorflow_cookbook

    安装相关底层依赖

    yum install -r python-devel python2-pip gcc vim
    

    使用豆瓣源

    mkdir -v ~/.pip && echo -e "[global]\ntimeout = 60\nindex-url = https://pypi.douban.com/simple" > ~/.pip/pip.conf
    

    克隆仓库

    git clone https://github.com/nfmcclure/tensorflow_cookbook.git
    cd tensorflow_cookbook
    # 这里面有 jupyter notebook
    pip install -r requirements.txt
    

    生成配置文件

    jupyter notebook --generate-config
    

    以上将会在 ~/.jupyter/ 下创建默认config 文件: jupyter_notebook_config.py
    修改这个 py 文件

    c.NotebookApp.port = 8080
    c.NotebookApp.ip = '你的服务器公网IP'
    c.NotebookApp.open_browser = False
    

    设置登录密码

    jupyter notebook password
    

    启动 notebook

    (nohup jupyter notebook --allow-root --ip=0.0.0.0 > deep.log &)
    

    按两次回车即可

    浏览器访问

    查看log

    cat deep.log
    

    看到 Jupyter Notebook 启动时有如下输出
    http://0.0.0.0:8080/tree

    复制到浏览器,修改了为自己服务器的公网 IP 即可,输入刚刚设置的密码。

    相关文章

      网友评论

          本文标题:在 Centos7 上搭建 Jupyter Notebook 环

          本文链接:https://www.haomeiwen.com/subject/vtfovxtx.html