Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 相同的Jupyter配置,两种不同的行为_Python_Jupyter Notebook_Jupyter_Jupyter Lab - Fatal编程技术网

Python 相同的Jupyter配置,两种不同的行为

Python 相同的Jupyter配置,两种不同的行为,python,jupyter-notebook,jupyter,jupyter-lab,Python,Jupyter Notebook,Jupyter,Jupyter Lab,我在另一台机器上使用了一个工作的Jupyter配置文件,并得到了以下错误。配置文件参数基本上是中给出的参数。有人能帮忙诊断吗 ubuntu@ip:~$ jupyter lab Traceback (most recent call last): File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 528, in get value = obj._trait_val

我在另一台机器上使用了一个工作的Jupyter配置文件,并得到了以下错误。配置文件参数基本上是中给出的参数。有人能帮忙诊断吗

ubuntu@ip:~$ jupyter lab
Traceback (most recent call last):
  File "/home/ubuntu/anaconda3/lib/python3.6/site-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 "/home/ubuntu/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 869, in _default_allow_remote
    addr = ipaddress.ip_address(self.ip)
  File "/home/ubuntu/anaconda3/lib/python3.6/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 "/home/ubuntu/anaconda3/bin/jupyter-lab", line 11, in <module>
    sys.exit(main())
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 1629, in initialize
    self.init_webapp()
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/jupyterlab/labapp.py", line 353, in init_webapp
    super().init_webapp(*args, **kwargs)
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 1379, in init_webapp
    self.jinja_environment_options,
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 158, in __init__
    default_url, settings_overrides, jinja_env_options)
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 251, in init_settings
    allow_remote_access=jupyter_app.allow_remote_access,
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
    return self.get(obj, cls)
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
    value = self._validate(obj, dynamic_default())
  File "/home/ubuntu/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 872, in _default_allow_remote
    for info in socket.getaddrinfo(self.ip, self.port, 0, socket.SOCK_STREAM):
  File "/home/ubuntu/anaconda3/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name or service not known
ubuntu@ip:$jupyter实验室
回溯(最近一次呼叫最后一次):
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/traitlets/traitlets.py”,get中第528行
value=obj.\u trait\u值[self.name]
KeyError:“允许远程访问”
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/notebook/notebookapp.py”,第869行,默认值为允许远程
addr=ipaddress.ip\u地址(self.ip)
文件“/home/ubuntu/anaconda3/lib/python3.6/ipaddress.py”,第54行,ip_地址
(地址)
ValueError:“”似乎不是IPv4或IPv6地址
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“/home/ubuntu/anaconda3/bin/jupyter lab”,第11行,在
sys.exit(main())
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/jupyter_core/application.py”,第266行,在launch_实例中
返回super(JupyterApp,cls)。启动_实例(argv=argv,**kwargs)
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/traitlets/config/application.py”,第657行,在launch_实例中
应用程序初始化(argv)
文件“”,第2行,在初始化中
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/traitlets/config/application.py”,第87行,catch\u config\u error
返回方法(应用程序、*args、**kwargs)
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/notebook/notebookapp.py”,第1629行,在初始化中
self.init_webapp()
init_webapp中的文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/jupyterlab/labapp.py”,第353行
super().init_webapp(*args,**kwargs)
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/notebookapp.py”,第1379行,在init_webapp中
self.jinja_环境_选项,
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/notebook/notebookapp.py”,第158行,在__
默认url、设置、覆盖、jinja\u环境选项)
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/notebook/notebookapp.py”,第251行,在init_设置中
allow_remote_access=jupyter_app.allow_remote_access,
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/traitlets/traitlets.py”,第556行,在__
返回self.get(obj、cls)
文件“/home/ubuntu/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py”,get中第535行
value=self.\u验证(obj,dynamic\u default())
文件“/home/ubuntu/anaconda3/lib/python3.6/site packages/notebook/notebookapp.py”,第872行,默认值为“允许远程”
有关socket.getaddrinfo(self.ip、self.port、0、socket.SOCK\u流)中的信息:
文件“/home/ubuntu/anaconda3/lib/python3.6/socket.py”,第745行,在getaddrinfo中
对于_socket.getaddrinfo(主机、端口、系列、类型、协议、标志)中的res:
socket.gaierror:[Errno-2]名称或服务未知

查看
~/.jupyter/jupyter\u notebook\u config.py
c.NotebookApp.ip='*'
,如果找到,将其更改为例如
c.NotebookApp.ip='0.0.0'
。这个给我修好了

资料来源: