notebook icon indicating copy to clipboard operation
notebook copied to clipboard

jupyter notebook failed to launch - Mac

Open arunadas opened this issue 8 years ago • 5 comments

Hi There!

I installed 2.7 anaconda today , after installation jupyter failed to launch with below error Last login: Fri Jul 7 10:35:14 on ttys002 /Users/arunadas/anaconda/bin/jupyter_mac.command ; exit; Python 2.7.10 (default, Jul 30 2016, 19:40:32) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin Type "help", "copyright", "credits" or "license" for more information.

/Users/arunadas/anaconda/bin/jupyter_mac.command ; exit; File "", line 1 /Users/arunadas/anaconda/bin/jupyter_mac.command ; exit; ^ SyntaxError: invalid syntax

Additional info My m/c is Macbook pro OS - MacOS siera , version 10.12.3 python is 2.7.10

Please suggest a work around or link to another version for overcoming version issue

arunadas avatar Jul 07 '17 18:07 arunadas

I don't know what that jupyter_mac.command file is - you may need to file an issue with anaconda about it, because I think it's something they add to our code.

takluyver avatar Jul 10 '17 07:07 takluyver

Sure will do , thanks!

arunadas avatar Jul 13 '17 16:07 arunadas

I got a different error..:

 antho@NY-ACheng # jupyter notebook                                          
Traceback (most recent call last):
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 528, in get
    value = obj._trait_values[self.name]
KeyError: 'runtime_dir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/antho/anaconda3/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 1294, in initialize
    self.init_configurables()
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 1033, in init_configurables
    connection_dir=self.runtime_dir,
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 556, in __get__
    return self.get(obj, cls)
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/traitlets/traitlets.py", line 535, in get
    value = self._validate(obj, dynamic_default())
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 99, in _runtime_dir_default
    ensure_dir_exists(rd, mode=0o700)
  File "/Users/antho/anaconda3/lib/python3.6/site-packages/ipython_genutils/path.py", line 167, in ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/Users/antho/anaconda3/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/Users/antho/anaconda3/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/Users/antho/anaconda3/lib/python3.6/os.py", line 210, in makedirs
    makedirs(head, mode, exist_ok)
  File "/Users/antho/anaconda3/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
OSError: [Errno 45] Operation not supported: '/home/antho'

 antho@NY-ACheng #sw_vers                                                   
ProductName:	Mac OS X
ProductVersion:	10.12.6
BuildVersion:	16G29

BTW here's my ~/anaconda3/bin/jupyter_mac.command

DIR=$(dirname $0)

$DIR/jupyter-notebook

AnthonyWC avatar Nov 17 '17 22:11 AnthonyWC

Ok I was able to bypass this error with using: sudo jupyter notebook --allow-root

Because the error was related to mkdir permission.

AnthonyWC avatar Nov 17 '17 22:11 AnthonyWC

We really don't recommend running Jupyter as root - the --allow-root flag is meant to be a signal that it's a bad idea. That error probably means that either some environment variable is set wrong, or there's something unusual about folder permissions.

takluyver avatar Nov 18 '17 22:11 takluyver