简体   繁体   English

在端口8888上找不到Jupyter Notebook服务器(Windows 10)

[英]Cannot find Jupyter Notebook server on port 8888 (Windows 10)

I'm trying to run a Docker container as a Jupyter Notebook on Windows 10. As shown in the screen grab, the notebook appears to be running on localhost:8888, but my browsers (Chrome and Edge) return a 'connection refused' error. 我正在尝试在Windows 10上运行Docker容器作为Jupyter Notebook。如屏幕抓取所示,笔记本似乎在localhost:8888上运行,但我的浏览器(Chrome和Edge)返回'连接被拒绝'错误。 I've disabled my firewall (temporarily), but that didn't help. 我已经禁用了我的防火墙(暂时),但这没有帮助。 Also, netstat does not list the port as being in use. 此外,netstat不会将端口列为正在使用中。 Any idea what's going on? 知道发生了什么事吗?

Screengrab显示Docker正在运行

Try the following: 请尝试以下方法:

docker run -p 8888:8888 -it simonwalkersamuel/bloch_tf:latest

-p 8888:8888 will map container port 8888 to host port 8888. -p 8888:8888将容器端口8888映射到主机端口8888。

TLDR make sure you mapped the ports using -p 8888:8888 . TLDR确保使用-p 8888:8888映射端口。 If didn't work, try 192.168.99.100:8888 instead of localhost:8888 . 如果不起作用,请尝试192.168.99.100:8888而不是localhost:8888

Situation: I had a slightly different problem: Although I mapped the ports using -p 8888:8888 , I still see the connection error when I try to reach localhost:8888 in all browsers. 情况:我有一个稍微不同的问题:虽然我使用-p 8888:8888映射端口,但是当我尝试在所有浏览器中访问localhost:8888时,我仍然看到连接错误。 The firewall is checked and seems OK. 检查防火墙,似乎没问题。 It was very confusing because exactly same docker image works on my other Win 10 laptop at work. 这是非常令人困惑的,因为完全相同的docker镜像在我工作的另一台Win 10笔记本电脑上工作。

Solution: I have two slightly different Win 10 on my laptops. 解决方案:我的笔记本电脑上有两个稍微不同的Win 10。 The one that has connection difficulty runs a Win 10 Home whereas the other one has a Win 10 Professional . 连接困难的一个运行Win 10 Home而另一个运行Win 10 Professional This means, the problematic laptop only runs Docker Tools not the conventional Docker CE. 这意味着,有问题的笔记本电脑只运行Docker Tools而不是传统的Docker CE。 Therefore, it maps communicates with the OS using 192.168.99.100 IP not the usual 127.0.0.1 or localhost . 因此,它使用192.168.99.100 IP而不是通常的127.0.0.1localhost来映射与OS的通信。 So, instead of localhost:8888 just used 192.168.99.100:8888 and it worked. 所以,而不是localhost:8888只使用192.168.99.100:8888 ,它的工作原理。

Confession! 忏悔! I usually use my work laptop for running Jupyter on docker. 我通常使用我的工作笔记本电脑在docker上运行Jupyter。 Therefore, I did not pay enough attention to the welcome message of Docker Quickstart Terminal which clearly says docker is configured to use the default machine with IP 192.168.99.100 . 因此,我没有足够重视Docker Quickstart Terminal的欢迎消息,该消息明确表示docker is configured to use the default machine with IP 192.168.99.100 Hopefully, this post helps other too busy (aka careless!) people like me! 希望,这篇文章可以帮助像我这样的其他太忙(也就是粗心!)的人!


Since both laptops have very similar apps installed, I doubt anything rather than the Docker app itself causes the difference in IP addresses. 由于两台笔记本电脑都安装了非常相似的应用程序,我怀疑是什么,而不是Docker应用程序本身导致IP地址的差异。

Try the following commands: 请尝试以下命令:

run these two command
pip install --upgrade pip
pip install --upgrade jupyter

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM