简体   繁体   English

更新后 Google Colab 无法连接到本地运行时

[英]Google Colab wont connect to local runtime after update

I recently updated jupter_over_ws to version 0.0.7 and now Google Colab refuses to connect my local runtime.我最近将 jupter_over_ws 更新到了 0.0.7 版,现在 Google Colab 拒绝连接我的本地运行时。

I have tried multiple iterations of launching the localhost in chrome, running with --no-browser etc and keep receiving a 'Forbidden' 403.我尝试了多次迭代,在 Chrome 中启动本地主机,使用 --no-browser 等运行,并不断收到“禁止”403。

The last iteration I got to in an attempt to connect to the notebook was:我试图连接到笔记本的最后一次迭代是:

jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --NotebookApp.port_retries=0 --notebook-dir="" --no-browser --allow-root --NotebookApp.token='' --NotebookApp.disable_check_xsrf=True --port=8888

Any help much appreciated非常感谢任何帮助

Colab recently updated it's local runtime connection instructions . Colab 最近更新了它的本地运行时连接说明

In particular, you'll need to provide the URL printed in the console when starting the local runtime.特别是,您需要在启动本地运行时提供在控制台中打印的 URL。

Clicking the "More Details" button in the local connection dialog will provide additional instructions.单击本地连接对话框中的“更多详细信息”按钮将提供其他说明。

After update, you need first upgrade jupyter_http_over_ws:更新后需要先升级jupyter_http_over_ws:

pip install --upgrade jupyter_http_over_ws

And second, everytime you start the server with this code:其次,每次使用以下代码启动服务器时:

jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0

It will show a new token in Anaconda's prompt, you need to copy.它将在 Anaconda 的提示中显示一个新令牌,您需要复制。

When you click in Connect to local runtime in Colab, a box will ask for the token, then paste there.当您在 Colab 中单击“ Connect to local runtime ,会出现一个框询问令牌,然后粘贴到那里。

If you use Anaconda, you can follow the instructions:如果您使用 Anaconda,则可以按照说明进行操作:

  1. Open cmd.exe as Administrator以管理员身份打开 cmd.exe
  2. Run pip install --upgrade jupyter_http_over_ws>=0.0.7 && jupyter serverextension enable --py jupyter_http_over_ws运行pip install --upgrade jupyter_http_over_ws>=0.0.7 && jupyter serverextension enable --py jupyter_http_over_ws
  3. Run jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8892 --NotebookApp.port_retries=0运行jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8892 --NotebookApp.port_retries=0
  4. Copy the URL from the command prompt printed console ex: http://localhost:8892/?token=fecaca2501d00f89971ab8fb4a5add3ff682ade7e63f7265从命令提示符打印的控制台复制 URL,例如: http://localhost:8892/?token=fecaca2501d00f89971ab8fb4a5add3ff682ade7e63f7265
  5. Paste the URL including token in Google Colab connection settings as Backend URL包含令牌URL粘贴到 Google Colab 连接设置中作为后端 URL

I solved this by removing the password from the jupyter .config file, then copy and pasting the token url as you have outlined in the answers above, and as outlined in the official colab documentation:我通过从 jupyter .config 文件中删除密码来解决这个问题,然后复制并粘贴上面答案中概述的令牌 URL,以及官方 colab 文档中的概述:

https://research.google.com/colaboratory/local-runtimes.htmlhttps://research.google.com/colaboratory/local-runtimes.html

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

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