5

I'm trying to connect local run time but it's not connecting,

I used the troubleshooting dialog following commands:

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

Have tried the same above steps as said in below URL https://research.google.com/colaboratory/local-runtimes.html

Facing an issue 'Jupyter authentication cookie was not detected' Tried by disabling adblocker, antivirus and also using different port numbers. Below was the solution given by team

Navigate to http://localhost:8888 in a separate browser tab and follow the provided instructions. This will set a browser cookie used for authentication between the browser and the Jupyter notebook server.

But when I open the URL, it asks for a password(already set up) and then no further instructions are appearing.

2
  • Do you get an error ? Mar 5, 2019 at 9:49
  • I didn't get an error but I'm not able to connect local runtime Mar 5, 2019 at 13:04

3 Answers 3

6

This issue was raised in Github issues for Collaboratory: This answer helped me https://github.com/googlecolab/jupyter_http_over_ws/issues/1#issuecomment-557469128

According to this issue

start the jupyter notebook with the below command.

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

then open the notebook by going to this URL.

localhost:8888

according to kris This may allow you to connect, but it basically disables all security features.

Then retry connecting to local runtime with Google Colab

If it does not solve your problem then try disabling AdBlock extension or app.

2
  • 1
    This may allow you to connect, but it basically disables all security features.
    – Kris
    Aug 3, 2021 at 13:23
  • Thank you!! In my case the issue was with UBlock origin, disabling it for google colab fixes the issue
    – Jotarata
    Aug 16 at 6:42
5

For Windows (10/11)

Method 1: Using git bash

follow these steps https://research.google.com/colaboratory/local-runtimes.html

Using git bash

Method 2: Using Windows terminal & Multiline commands

Install jupyter_http_over_ws

pip install jupyter_http_over_ws

enable the jupyter_http_over_ws jupyter extension (one-time)

jupyter serverextension enable --py jupyter_http_over_ws

Use multiline commands to start server and authenticate

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

Using mutilines & Windows terminal

Method 3: Using single-line command & windows terminal

Install jupyter_http_over_ws

pip install jupyter_http_over_ws

enable the jupyter_http_over_ws jupyter extension (one-time)

jupyter serverextension enable --py jupyter_http_over_ws

Use single-line commands to start server and authenticate

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

Using Single line and windows terminal

Once the server has started, it will print a message with the initial backend URL used for authentication. Make a copy of this URL as you'll need to provide this in the next step.

enter image description here

Connect to the local runtime In Colaboratory, click the "Connect" button and select "Connect to local runtime...". Enter the URL from the previous step in the dialog that appears and click the "Connect" button. After this, you should now be connected to your local runtime.

enter image description here

1
  • 1
    In my case, it was port sensitive. I needed to kill another process which was running on port 8888. May 4, 2022 at 17:11
0

There are several reasons why a local connection might fail. To gather more diagnosis information, click the 'troubleshoot' link in the notification that appears in the lower left of the screen.

It will look like this: enter image description here

I'd recommend following whatever steps are recommended there. If you get stuck, please update your original question with the diagnosis offered in the troubleshooting dialog.

3
  • I have used Troubleshoot commands only but still I'm not able to connect Mar 6, 2019 at 7:10
  • More information will be helpful to diagnose. For example: What adjustments were recommended by the troubleshoot command? How did you change your invocation? What error are you observing? Is your Jupyter backend running locally, or are you attempting to connect remotely via an SSH tunnel?
    – Bob Smith
    Mar 6, 2019 at 17:05
  • 1
    When I run Troubleshoot command Jupyter browser is opening but Colab is not connecting to local runtime again its showing Troubleshooting dialog Mar 8, 2019 at 10:08

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.