在Arch上安装Jupyter时出现问题 [英] Issue installing Jupyter on Arch
问题描述
我正在尝试启动 Jupyter 笔记本并在Arch上运行.我尝试安装jupyter
软件包.我还尝试遵循 Arch Wiki ,并安装了jupyter-notebook
和jupyter-nbconvert
和python-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进行传递.特别是当我们仅侦听本地回送地址时,我们可以传递localhost
或127.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屋!