在阿里云ECS云端运行Jupyter Notebook

原文链接:https://my.oschina.net/wuliong/blog/1581470

安装Python
安装Jupyter
在ECS安全组添加规则,入方向+端口8888/8888
设置Jupyter登陆密码

ipython

ln [1]: from notebook.auth import passwd
ln [2]: passwd()
Enter password: #生成密码
Verify password: #确认密码
Out[2] 'sha1:******' #复制引号间sha1开头的字符

jupyter notebook --generate-config
nano ~/.jupyter/jupyter_notebook_config.py

在配置文件中添加一下内容:

c.NotebookApp.ip = '*'
c.NotebookApp.password = u'sha1:****'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888

启动Jupyter

Jupyter Notebook &

除了启动Jupyter的连接之外,其它所有连接都要退出。

打开浏览器,输入访问地址:http://<ip_address>:8888,在登陆界面输入刚才设置的密码就可以登陆了。

转载于:https://my.oschina.net/wuliong/blog/1581470

展开阅读全文
博主设置当前文章不允许评论。

运行jupyter notebook 出现如下报错

12-05

环境 anaconda2 tensorflow1.10.1 python2.7 jupyter notebook 4.2.1rn报错如下:rn Kernel started: 3ffc7b27-5215-4d1c-b6c2-3c4236ba7789rnTraceback (most recent call last):rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/runpy.py", line 174, in _run_module_as_mainrn "__main__", fname, loader, pkg_name)rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/runpy.py", line 72, in _run_codern exec code in run_globalsrn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/ipykernel_launcher.py", line 16, in rn app.launch_new_instance()rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/traitlets/config/application.py", line 657, in launch_instancern app.initialize(argv)rn File "", line 2, in initializern File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/traitlets/config/application.py", line 87, in catch_config_errorrn return method(app, *args, **kwargs)rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 469, in initializern self.init_sockets()rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 260, in init_socketsrn self.init_iopub(context)rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/ipykernel/kernelapp.py", line 268, in init_iopubrn self.iopub_thread = IOPubThread(self.iopub_socket, pipe=True)rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/ipykernel/iostream.py", line 66, in __init__rn self.io_loop = IOLoop(make_current=False)rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tornado/util.py", line 209, in __new__rn instance.initialize(**args)rn File "/home/ghf/anaconda2/envs/tensorflow/lib/python2.7/site-packages/tornado/platform/epoll.py", line 26, in initializern super(EPollIOLoop, self).initialize(impl=select.epoll(), **kwargs)rnTypeError: initialize() got an unexpected keyword argument 'make_current'rnrnKernelRestarter: restart failedrnThe kernel has died, and the automatic restart has failed. It is possible the kernel cannot be restarted. If you are not able to restart the kernel, you will still be able to save the notebook, but running code will no longer work until the notebook is reopened. 论坛

Jupyter Notebook的主题编码问题

02-10

最近因为jupyter notebook的白色原装界面太难看了,特别是字体。然后,就install nJupyter themes; 一切都OK,themes也下载下来了,进行 jt -l 也是没问题的,正常n显示出了已经有的各个主题了。n最后,进行 jt -t 主题名 启用时,报错了。无法切换主题:nn(C:\Users\Administrator\Anaconda3) C:\Users\Administrator>jt -lnAvailable Themes:n chesterishn grade3n gruvboxdn gruvboxln monokain oceans16n onedorkn solarizeddn solarizedlnn(C:\Users\Administrator\Anaconda3) C:\Users\Administrator>jt -t grade3nTraceback (most recent call last):n File "c:\users\administrator\anaconda3\lib\runpy.py", line 193, in _run_module_as_mainn "__main__", mod_spec)n File "c:\users\administrator\anaconda3\lib\runpy.py", line 85, in _run_coden exec(code, run_globals)n File "C:\Users\Administrator\Anaconda3\Scripts\jt.exe\__main__.py", line 9, in n File "c:\users\administrator\anaconda3\lib\site-packages\jupyterthemes\__init__.py", line 307, in mainn dfonts=args.defaultfonts)n File "c:\users\administrator\anaconda3\lib\site-packages\jupyterthemes\__init__.py", line 103, in install_themen style_css = stylefx.less_to_css(style_less)n File "c:\users\administrator\anaconda3\lib\site-packages\jupyterthemes\stylefx.py", line 63, in less_to_cssn style_css = lesscpy.compile(tempfile)n File "c:\users\administrator\anaconda3\lib\site-packages\lesscpy\__init__.py", line 18, in compilen p.parse(file=file)n File "c:\users\administrator\anaconda3\lib\site-packages\lesscpy\lessc\parser.py", line 154, in parsen file, lexer=self.lex, debug=debuglevel)n File "c:\users\administrator\anaconda3\lib\site-packages\ply\yacc.py", line 331, in parsen return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)n File "c:\users\administrator\anaconda3\lib\site-packages\ply\yacc.py", line 1024, in parseopt_notrackn lexer.input(input)n File "c:\users\administrator\anaconda3\lib\site-packages\lesscpy\lessc\lexer.py", line 475, in inputn self.lexer.input(f.read())nUnicodeDecodeError: 'gbk' codec can't decode byte 0x8b in position 44256: illegal multibyte sequencen 问答

没有更多推荐了,返回首页