jupyter 设置远程访问配置过程及问题的解决
很早之前试图将jupyter装在服务器上,但没有成功,就以为不行这样,然后不了了之。 最近同学在弄,成功了,我就又搞了一次。记录下,过程与怎么去解决遇到的问题的。
在服务器配好jupyter的环境及下载jupyter
这里就不说了,网上一搜一大篇
在服务器上的配置
- 生成jupyter的默认配置文件
jupyter notebook --generate-config
- 生成密码(后面会用到)
在命令行输入
ipython
再输入
from notebook.auth import passwd
passwd()
-
输入你的密码并记住,得到一个**并复制下来。
vim ~/.jupyter/jupyter_notebook_config.py
加入
c.NotebookApp.ip='*'
c.NotebookApp.password = u'复制的**'
c.NotebookApp.open_browser = False
c.NotebookApp.port =xxxx #自定义需后面访问的端口
4.遇到的问题(KeyError: ‘allow_remote_access’)
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/traitlets/traitlets.py”, line 528, in get
value = obj._trait_values[self.name]
KeyError: ‘allow_remote_access’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py”, line 869, in _default_allow_remote
addr = ipaddress.ip_address(self.ip)
File “/usr/lib/python3.5/ipaddress.py”, line 54, in ip_address
address)
ValueError: ‘’ does not appear to be an IPv4 or IPv6 address
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/usr/local/bin/jupyter-notebook”, line 11, in
sys.exit(main())
File “/usr/local/lib/python3.5/dist-packages/jupyter_core/application.py”, line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File “/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py”, line 657, in launch_instance
app.initialize(argv)
File “”, line 2, in initialize
File “/usr/local/lib/python3.5/dist-packages/traitlets/config/application.py”, line 87, in catch_config_error
return method(app, *args, **kwargs)
File “/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py”, line 1629, in initialize
self.init_webapp()
File “/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py”, line 1379, in init_webapp
self.jinja_environment_options,
File “/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py”, line 158, in init
default_url, settings_overrides, jinja_env_options)
File “/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py”, line 251, in init_settings
allow_remote_access=jupyter_app.allow_remote_access,
File “/usr/local/lib/python3.5/dist-packages/traitlets/traitlets.py”, line 556, in get
return self.get(obj, cls)
File “/usr/local/lib/python3.5/dist-packages/traitlets/traitlets.py”, line 535, in get
value = self._validate(obj, dynamic_default())
File “/usr/local/lib/python3.5/dist-packages/notebook/notebookapp.py”, line 872, in _default_allow_remote
在配置文件中加入
c.NotebookApp.allow_remote_access = True
tip
如果你是阿里云,增加一个你要访问的端口
bye!!
推荐阅读
-
Ubuntu Server 16.04安装MySQL设置远程访问出现问题的完美解决方案(error:10061)
-
PHP无法访问远程mysql的问题分析及解决
-
Unix下配置Scheduler的过程及出现问题的解决
-
MySQL集群架构及配置过程中出现问题的解决
-
PHP无法访问远程mysql的有关问题分析及解决
-
Jupyter Lab3.0远程访问配置及代码无法自动补全问题
-
【Laravel5.5 笔记整理一】用 虚拟域名访问 报错问题解决及虚拟域名的配置
-
PHP无法访问远程mysql的问题分析及解决
-
PHP无法访问远程mysql的问题分析及解决_php技巧
-
PHP无法访问远程mysql的问题分析及解决_PHP