美文网首页
服务器安装jupyter notebook、远程访问及NB插件

服务器安装jupyter notebook、远程访问及NB插件

作者: 手握镰刀和锤子的打工人 | 来源:发表于2021-04-20 20:15 被阅读0次

1、使用conda安装jupyter notebook

conda install jupyter notebook

2、使用域名访问服务器Jupyter Notebook

[这里参考jlrleung的第一种方法]第二种方法可以一劳永逸(https://blog.csdn.net/weixin_42309722/article/details/111956799)
方法1. ssh远程使用jupyter notebook

  1. 在远程服务器上,启动jupyter notebooks服务:
jupyter notebook --no-browser --port=8889
  1. 在本地终端中启动SSH:
ssh -N -f -L localhost:8888:localhost:8889 username@serverIP

其中: -N 告诉SSH没有命令要被远程执行; -f 告诉SSH在后台执行; -L 是指定port forwarding的配置,远端端口是8889,本地的端口号的8888。
注意:username@serverIP替换成服务器的对应账号。

  1. 如果服务器没有IP地址怎么办?
  • 首先可以在NAT123网站上申请一个账号,然后购买一个非80端口网络映射服务,一年大概200~300块。配置如下:


    截屏2021-04-28 下午12.03.48.png

    效果如下:


    截屏2021-04-28 下午12.07.07.png
  • 如果遇到“连接不是私密连接”,可以将网址前的http改成https;如果还有同学用的是chrome浏览器,在当前页面输入thisisunsafe,不是在地址栏输入,就直接敲键盘就行了,页面即会自动刷新进入网页。

3、安装NB(牛逼)插件,参考网址链接

  1. 安装nbextensions
pip3 install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
  1. 安装nbextensions_configurator
pip3 install jupyter_nbextensions_configurator
jupyter nbextensions_configurator enable --user
  1. 安装完成重启后不显示Nbextensions
  • 先卸载 jupyter_contrib_nbextensions和 jupyter_nbextensions_configurator
pip3 uninstall jupyter_contrib_nbextensions
pip3 uninstall jupyter_nbextensions_configurator
  1. 使用conda安装
conda install -c conda-forge jupyter_contrib_nbextensions

重新启动,大功告成。

相关文章

网友评论

      本文标题:服务器安装jupyter notebook、远程访问及NB插件

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