1.XSHELL登录服务器
2.检查是否有安装jupyter notebook,终端输入jupyter notebook,如果报错就是没有啦,那么就要用下面命令安装。
pip install jupyter
3.生成配置文件
jupyter notebook --generate-config
4.生成密码(后续写配置文件、登录Jupyter notebook需要)
打开python终端
from IPython.lib import passwd
passwd()
Enter password: #这里点击回车
Verify password: #同上
'sha1:0e422dfccef2:84cfbcbb3ef95872fb8e23be3999c123f862d856'#这是输出
5.修改默认配置文件
vim ~/.jupyter/jupyter_notebook_config.py
也可以:通过XFTP显示隐藏文件夹找到并打开文件,在空白处添加这几行:
c.NotebookApp.ip='*'
c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #随便指定一个端口
c.IPKernelApp.pylab = 'inline'
6.启动Jupter notebook
jupyter notebook
7.远程访问
此时应该可以直接从本地浏览器直接访问http://address_of_remote:8888就可以看到jupyter的登陆界面。(特别注意:服务器上的Jupyter notebook不要关)
其中,address_of_remote是服务器IP地址。
遇到的一些问题:服务器有多个python环境,安装打开jupyter notebook总是会混淆。。。。诸如此类