在Arch上安装Jupyter时出现问题 [英] Issue installing Jupyter on Arch

查看:241
本文介绍了在Arch上安装Jupyter时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试启动 Jupyter 笔记本并在Arch上运行.我尝试安装jupyter软件包.我还尝试遵循 Arch Wiki ,并安装了jupyter-notebookjupyter-nbconvertpython-ipywidgets.最后,我尝试使用 pip说明.所有这三个都失败并给出:

I am trying to get a Jupyter notebook up and running on Arch. I have tried installying the jupyter package. I also tried following the Arch wiki and installed jupyter-notebook and jupyter-nbconvert and python-ipywidgets. Lastly, I tried using the pip instructions. All three of which fail and give:

➜  ~ jupyter notebook
Traceback (most recent call last):
  File "/usr/sbin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/usr/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 "/usr/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/usr/lib/python3.6/site-packages/notebook/notebookapp.py", line 1368, in initialize
    self.init_webapp()
  File "/usr/lib/python3.6/site-packages/notebook/notebookapp.py", line 1188, in init_webapp
    self.http_server.listen(port, self.ip)
  File "/usr/lib/python3.6/site-packages/tornado/tcpserver.py", line 142, in listen
    sockets = bind_sockets(port, address=address)
  File "/usr/lib/python3.6/site-packages/tornado/netutil.py", line 197, in bind_sockets
    sock.bind(sockaddr)
OSError: [Errno 22] Invalid argument

其他 报告与此相关的sock.bind错误.我不确定这个问题是否相关.任何对此事的指导将不胜感激.

It seems that the other reports related to this involve a different error with sock.bind. I am not sure if the issue is related or not. Any guidance on the matter would be appreciated.

推荐答案

通常使用socket.bind()时,可以将其作为主机名或ip进行传递.特别是当我们仅侦听本地回送地址时,我们可以传递localhost127.0.0.1(对于ip v4)或::1进行ip v6.

When using socket.bind() usually you can pass it either a hostname or an ip. In particular as we oly listen on the local loopback address we can pass either localhost or 127.0.0.1 (for ip v4) or ::1 for ip v6.

理论中,两者是相同的,但实际上,在许多系统中,一个(或另一个)存在问题.它可能是防火墙,并且防病毒软件将此绑定视为可疑或奇怪的网络配置.虽然您可能仍然应该调查为什么socket.bind()拒绝localhost的情况(在您的情况下),但是您可以使用以下命令将jupyter笔记本服务器配置为直接绑定到127.0.0.1:jupyter notebook --ip=127.0.0.1或更改jupyter笔记本服务器的配置使用等效的长格式选项c.NotebookApp.ip='127.0.0.1'.

In theory both would be identical, but in practice there are number of systems where one (or the other) is problematic. It can be firewall, and antivirus seeing this binding as suspicious, or strange network configurations. While you probably still should investigate why socket.bind() refuses localhost (in your case), you can configure the jupyter notebook server to bind directly to 127.0.0.1 by using either : jupyter notebook --ip=127.0.0.1, or change the configuration of jupyter notebook server with the equivalent long form option c.NotebookApp.ip='127.0.0.1'.

如果他在Arch上很流行(并通过arch存储库安装),我建议联系arch软件包维护者以获取一个自定义补丁,将默认值切换为127.0.0.1.

Also if his is widespread on Arch (and install via the arch repo) I would suggest contacting the arch package maintainer to have a custom patch that switch the default value to 127.0.0.1.

这篇关于在Arch上安装Jupyter时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆