Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 900
Hanshenry90 Avatar asked May 18 '17 20:05

Hanshenry90


People also ask

Why my Jupyter Notebook is not opening in CMD?

Why my Jupyter Notebook is not opening in command prompt? Jupyter fails to start If you're using a menu shortcut or Anaconda launcher to start it, try opening a terminal or command prompt and running the command jupyter notebook . If it can't find jupyter , you may need to configure your PATH environment variable.

How do I run Ipython notebook from command line?

3.1. Click on spotlight, type terminal to open a terminal window. Enter the startup folder by typing cd /some_folder_name . Type jupyter notebook to launch the Jupyter Notebook App The notebook interface will appear in a new browser window or tab.

How do I start a Jupyter Notebook in terminal?

How to open Jupyter Notebook. To launch a Jupyter notebook, open your terminal and navigate to the directory where you would like to save your notebook. Then type the command jupyter notebook and the program will instantiate a local server at localhost:8888 (or another specified port).


2 Answers

This issue due to the newest Mac OSX 10.12.5 upgrade. Please follow these steps to fix it:

  1. Generate jupyter config if you don't have it:
    jupyter notebook --generate-config
  2. 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)
like image 62
Kiem Nguyen Avatar answered Oct 19 '22 01:10

Kiem Nguyen


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.

like image 31
Victor Vulovic Avatar answered Oct 19 '22 01:10

Victor Vulovic