[英]“Unable to connect to the local runtime” in google colab
我正在嘗試連接本地運行時,但它沒有連接,
我使用了以下命令的故障排除對話框:
pip install jupyter_http_over_ws
jupyter serverextension enable --py jupyter_http_over_ws
jupyter notebook \ --NotebookApp.allow_origin='https://colab.research.google.com --port=8888 \--NotebookApp.port_retries=0
已嘗試與以下 URL https://research.google.com/colaboratory/local-runtimes.html 中所述相同的上述步驟
面臨“未檢測到 Jupyter 身份驗證 cookie”的問題通過禁用廣告攔截器、防病毒軟件並使用不同的端口號進行了嘗試。 以下是團隊給出的解決方案
在單獨的瀏覽器選項卡中導航到http://localhost:8888並按照提供的說明進行操作。 這將設置用於在瀏覽器和 Jupyter 筆記本服務器之間進行身份驗證的瀏覽器 cookie。
但是當我打開 URL 時,它要求輸入密碼(已經設置),然后沒有進一步的說明出現。
這個問題在協作的 Github 問題中提出:這個答案幫助了我https://github.com/googlecolab/jupyter_http_over_ws/issues/1#issuecomment-557469128
根據這個問題
使用以下命令啟動 jupyter notebook。
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
然后通過轉到此 URL 打開筆記本。
localhost:8888
然后重新嘗試使用 Google Colab 連接到本地運行時
如果它不能解決您的問題,請嘗試禁用 AdBlock 擴展程序或應用程序。
對於 Windows (10/11)
方法一:使用git bash
按照這些步驟https://research.google.com/colaboratory/local-runtimes.html
方法 2:使用 Windows 終端和多行命令
安裝 jupyter_http_over_ws
pip install jupyter_http_over_ws
啟用 jupyter_http_over_ws jupyter 擴展(一次性)
jupyter serverextension enable --py jupyter_http_over_ws
使用多行命令啟動服務器並進行身份驗證
jupyter notebook ^
--NotebookApp.allow_origin='https://colab.research.google.com' ^
--port=8888 ^
--NotebookApp.port_retries=0
方法 3:使用單行命令和 windows 終端
安裝 jupyter_http_over_ws
pip install jupyter_http_over_ws
啟用 jupyter_http_over_ws jupyter 擴展(一次性)
jupyter serverextension enable --py jupyter_http_over_ws
使用單行命令啟動服務器並進行身份驗證
jupyter notebook --NotebookApp.allow_origin='https://colab.research.google.com' --port=8888 --NotebookApp.port_retries=0
服務器啟動后,它將打印一條消息,其中包含用於身份驗證的初始后端 URL。 復制此 URL,因為您需要在下一步中提供它。
連接到本地運行時在 Colaboratory 中,單擊“連接”按鈕並選擇“連接到本地運行時...”。 在出現的對話框中輸入上一步中的 URL,然后單擊“連接”按鈕。 在此之后,您現在應該連接到本地運行時。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.