Error connecting to Jupyter notebook localhost - jupyter-notebook

I've tried looking this up, found something similar but not quite. I'm new so if I've posted something commonly posted, my apologies!
When I run jupiter notebook on terminal, this shows up:
Serving notebooks from local directory: /home/myname/Jupyter
0 active kernels
The Jupyter Notebook is running at: http://localhost:8888/?token=9da2454c0873c8989e93c42f9cc0ee5892da4da6e02fd9b5
Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
No web browser found: could not locate runnable browser.
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=9da2454c0873c8989e93c42f9cc0ee5892da4da6e02fd9b5
And then when I paste the link to google chrome it says
Safari can't open the page "http://localhost:8888/?token=9da2454c0873c8989e93c42f9cc0ee5892da4da6e02fd9b5" because Safari can't connect to the server "localhost."
I've looked at some other similar issues but I can't find a definite solution other than that port 8888 is being used? Any advice appreciated!
Notes: I've tried this on a Mac running OS X El Capitan version 10.11.6

I had the same issue. What I did was following.
Step 1: Go to Windows start menu and search for Anaconda Prompt (Anaconda3)
Step 2: Type "jupyter notebook" and click "Enter" btn
Step 3: Instead of using localhost use port 127.0.0.1.
Note: Port may be different for you, so just check before you try.

Related

Jupyter-notebook fails to start | PyForMLS

I am currently setting up a Python data-science client for SQL Server Machine Learning Services following this guide: https://learn.microsoft.com/en-us/sql/machine-learning/python/setup-python-client-tools-sql?view=sql-server-ver15
Unfortunately, running Jupyter notebooks for this distribution does not seem to work for me: Typing .\Scripts\jupyter-notebook in the distribution folder, or directly running jupyter-notebook.exe from the Scripts sub-folder does not start Jupyter. In the terminal, the command exits with no ouput.
Afterwards, https://localhost:8889/tree is not reachable as should be the case according to the tutorial above.
Any suggestions? (I already checked https://jupyter-notebook.readthedocs.io/en/stable/troubleshooting.html for solutions). Thank you!
Update: At least .\Scripts\jupyter-console is running, though it is not the same experience.
some cases .\Scripts\jupyter-notebook will not work fine because of the installation issues. As anaconda is having both commercial and enterprise editions, issues will raise.
Instead use the following procedure for cool opening of Jupyter-Notebook in anaconda distribution
Click on Start menu
Type Jupyter
Click on jupter icon which is visible in search results
Jupyter CMD will start running and make it minimized instead closing it. It will open the UI of jupyter notebook in browser.
Jupyter notebook for SQL
Check the documentation link which is available in link which is the configuration of jupyter notebook for SQL.
Document Credit: Rajendra Gupta
https://localhost:8889/tree

Jupyter Notebook "Password or token" issue

I am trying to open the jupyter in the firefox since I've always opened it in chrome. and what should I do to tackle this password? Thanks in advance
When you start a jupyter server locally, you type jupyter notebook in a cmd console. And then you get an output similar to this:
Jupyter should then redirect you to localhost:8888 in your browser. If it asks you for your token/password, you can find it in the console, last line. In the case of this image, the token is 5fe355c8a0e68158fed7b498805097811951f519809d7b44

Issue running jupyter notebook via wls

Installed WSL on Windows 10.
Installed Anaconda according to the Anaconda documentation with the following commands:
bash Anaconda3-2020.02-Linux-x86_64.sh
source ~/.bashrc
You can see the '(base)' in the beginning of each command input line, indicating the conda is activated.
Then I run jupyter notebook by typing:
jupyter notebook
Then I see the following changes as shown in the screen record.
Briefly, the WSL terminal window showed some information very quickly, but is changed to the windows powershell window before you could even tell the information that showed up. I know those information should contain a file and url for opening the jupyter notebook in the web browser. But they flashed out so quickly. Does anyone know why this happens?
Here is a dynamic graph of the Screen record of this issue:
Solved:
1. Wait for a bit more time on the windows cmd and the jupyter notebook running information will show up, where includes the url to open jupyter notebook in the web browser.
OR
Open up another wsl terminal, activate the same environment and type jupyter notebook list, which will show the current running jupyter notebook server. The url is also can be found there.

Unable to start Jupyter lab or Jupyter notebook in a browser

I get the following log when starting Jupyter lab or Jupyter notebook-
[W 17:03:08.963 NotebookApp] No web browser found: could not locate runnable browser.
and Jupyter does not start a browser (or a tab in a browser).
(I am using Linux - Manjaro i3 community edition)
I have configured Jupyter to use google-chrome-stable by
jupyter notebook --generate-config
and setting the following line in ~/.jupyter/jupyter_notebook_config.py
c.NotebookApp.browser = '/usr/bin/google-chrome-stable'
(Yes I have uncommented the above line)
/usr/bin/google-chrome-stable and google-chrome-stable successfully launch chrome from the terminal.
I have also tried
jupyter lab --browser=google-chrome-stable
jupyter lab --browser google-chrome-stable
without success.
Jupyter used to open in a browser when I had Pale Moon installed on my system, but now that I have removed it, I cannot seem to get this working. google-chrome-stable is my default browser now.
The obvious workaround is to copy the localhost URL to a web browser but I am trying to avoid that.
Posting dsjamieson's answer here:
You have to give your browser (“google-chrome-stable” in this case) a string format argument (%s) in order to pass it the notebook’s URL:
jupyter lab --browser="google-chrome-stable %s"
or, if you prefer opening chrome in app mode:
jupyter lab --browser="google-chrome-stable --app=%s"
For Jupyter Lab, to make this more permanent:
jupyter-lab --generate-config
Then edit ~/.jupyter/jupyter_lab_config.py and set the ff:
c.ServerApp.browser = 'google-chrome-stable %s'
Or do a variation of double0darbo's answer above.

Ipython notebook will not start on command line

I tried to open ipython in terminal with ipython notebook and it will not open ipython notebook. It gives the following error:
| ~/documents/ud120-projects/datasets_questions # HJ (JiaHui)
| => ipython notebook
[TerminalIPythonApp] WARNING | Subcommand `ipython notebook` is deprecated and
will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter notebook` in
the future
[I 14:46:50.516 NotebookApp] Serving notebooks from local directory:
/Users/JiaHui/Documents/ud120-projects/datasets_questions
[I 14:46:50.517 NotebookApp] 0 active kernels
[I 14:46:50.517 NotebookApp] The Jupyter Notebook is running at:
http://localhost:8888/?token=ef13f681f4d61223064e41a5a9e369813c155d27b0103471
[I 14:46:50.517 NotebookApp] Use Control-C to stop this server and shut down
all kernels (twice to skip confirmation).
[C 14:46:51.567 NotebookApp]
Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?
token=ef13f681f4d61223064e41a5a9e369813c155d27b0103471
0:97: execution error: "http://localhost:8888/tree?
token=145eccd35722c35c6525d8a4d376f27aa60358dc7d00de4c" doesn’t understand the
“open location” message. (-1708)
I have upgraded conda jupyter but it still won't work. How can I fix this?
This issue due to the newest Mac OSX 10.12.5 upgrade. Please follow these steps to fix it:
Generate jupyter config if you don't have it:
jupyter notebook --generate-config
Use vim to open that config file and add Google chrome value in:
c.NotebookApp.browser = u'chrome' (Make sure to take out the # comment sign)
I used the same approach as Kiem Nguyen above, but 'chrome' wouldn't work for me, even after editing my .bash_profile as Hanshenry90 suggested.
To use Safari to view the notebook, open your terminal and enter:
jupyter notebook --generate-config
cd ~.jupyter
nano jupyter_notebook_config.py
ctrl + w "NotebookApp.browser" + enter to skip to that part of the file. Then delete # and change the line to:
c.NotebookApp.browser = u'Safari'
Restart your notebook, with jupyter notebook, and it should open in Safari.
If anyone has any insight on how to make this work for Chrome, that would be much appreciated.
I liked most imarti's solution:
export BROWSER=open
It is low overhead and works with your default browser
EDIT: macOS 10.12.6 has been released, so now the recommended solution is to just update your OS.
editing my nano .bash_profile file to contain the lines:
BROWSER=/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
export BROWSER
Not the best fix, but a potential workaround...
Go to your browser and enter the login token provided.
In your case: http://localhost:8888/
After starting a new notebook, I found that my kernel would die and be unable to restart. Updating my ipykernel fixed this:
pip install ipykernel --upgrade
This is an issue possibly due to the recent upgrade of Mac OSX. You can follow the discussion and possible solutions here, here and here.

Resources