jupyter

作者: 点点渔火 | 来源:发表于2018-04-12 23:22 被阅读0次

ipython notebook是一个基于浏览器的python数据分析工具,使用起来非常方便,具有极强的交互方式和富文本的展示效果。jupyter是它的升级版,它的安装也非常方便,一般Anaconda安装包中会自带。安装好以后直接输入jupyter notebook便可以在浏览器中使用。

远程服务器访问

  1. 登陆远程服务器

  2. 生成配置文件
    $jupyter notebook --generate-config

  3. 生成密码
    打开ipython,创建一个密文的密码:
    In [1]: from notebook.auth import passwd
    In [2]: passwd()
    Enter password:
    Verify password:
    Out[2]: 'sha1:ce23d945972f:34769685a7ccd3d08c84a18c63968a41f1140274'

把生成的密文‘sha:ce…’复制下来

  1. 修改默认配置文件
    $vim ~/.jupyter/jupyter_notebook_config.py 进行如下修改:
    c.NotebookApp.ip='*'
    c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'
    c.NotebookApp.open_browser = False
    c.NotebookApp.port =8888 #随便指定一个端口
    c.NotebookApp.notebook_dir = ‘~/jupyter'

  2. 启动jupyter notebook:
    $jupyter notebook

  3. 远程访问
    此时应该可以直接从本地浏览器直接访问http://address_of_remote:8888就可以看到jupyter的登陆界面。

  4. 建立ssh通道
    如果登陆失败,则有可能是服务器防火墙设置的问题,此时最简单的方法是在本地建立一个ssh通道: 在本地终端中输入ssh username@address_of_remote -L127.0.0.1:1234:127.0.0.1:8888 便可以在localhost:1234直接访问远程的jupyter了。

配置scala和Spark环境

https://github.com/alexarchambault/jupyter-scala

jupyter kernelspec list 目前只有python的kernel:
anaconda2/lib/python2.7/site-packages/ipykernel/resources

参考: https://blog.csdn.net/qq_30901367/article/details/73296887
https://stackoverflow.com/questions/35563545/how-do-i-install-scala-in-jupyter-ipython-notebook

其它配置

https://segmentfault.com/a/1190000009305646

jupyter notebook --no-browser --port 6000 --ip=192.168.1.103

相关文章

网友评论

    本文标题:jupyter

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