iPython notebook not working with anaconda python on Macintosh

已完成

I'm unable to actually execute code from the iPython notebook interface with community 2016-2.1 and version 4.1.1 of Anaconda Python on a MacBook. When I open a new blank notebook, I get a blank cell as expected. But when I execute it after entering a command, after I select the url for the notebook server, I get the following traceback in the run window:


/usr/local/anaconda/bin/python /usr/local/anaconda/bin/jupyter-notebook --no-browser --ip 127.0.0.1 --port 8888
[W 13:16:47.191 NotebookApp] Unrecognized JSON config file version, assuming version 1
Traceback (most recent call last):
File "/usr/local/anaconda/bin/jupyter-notebook", line 6, in <module>
sys.exit(notebook.notebookapp.main())
File "/usr/local/anaconda/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/usr/local/anaconda/lib/python2.7/site-packages/traitlets/config/application.py", line 595, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/usr/local/anaconda/lib/python2.7/site-packages/traitlets/config/application.py", line 74, in catch_config_error
return method(app, *args, **kwargs)
File "/usr/local/anaconda/lib/python2.7/site-packages/notebook/notebookapp.py", line 1069, in initialize
self.init_configurables()
File "/usr/local/anaconda/lib/python2.7/site-packages/notebook/notebookapp.py", line 837, in init_configurables
parent=self,
File "/usr/local/anaconda/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 19, in __init__
specs = self.find_kernel_specs() or {}
File "/usr/local/anaconda/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 129, in find_kernel_specs
self.conda_info = self._conda_info()
File "/usr/local/anaconda/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 29, in _conda_info
p = subprocess.check_output(["conda", "info", "--json"]
File "/usr/local/anaconda/lib/python2.7/subprocess.py", line 567, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/local/anaconda/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/local/anaconda/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory

If I manually start the notebook server from a terminal window, I still cannot get the cell to execute. I get a long traceback in the terminal window that ends with: NoSuchKernel: No such kernel named python2 . I can, however, start either a jupyter notebook or a qtconsole session by connecting to the localhost:8888 address.

Does anyone know what setting I need to change in order to make this work?

1

Hello There,

I have the same problem on Ubuntu. This is pretty cool feature but not working.

 

/home/s77/anaconda2/bin/python /home/s77/anaconda2/bin/jupyter-notebook --no-browser --ip 127.0.0.1 --port 8888
[W 17:33:17.598 NotebookApp] Unrecognized JSON config file version, assuming version 1
Traceback (most recent call last):
  File "/home/s77/anaconda2/bin/jupyter-notebook", line 6, in <module>
    sys.exit(notebook.notebookapp.main())
  File "/home/s77/anaconda2/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/s77/anaconda2/lib/python2.7/site-packages/traitlets/config/application.py", line 595, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/home/s77/anaconda2/lib/python2.7/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/home/s77/anaconda2/lib/python2.7/site-packages/notebook/notebookapp.py", line 1069, in initialize
    self.init_configurables()
  File "/home/s77/anaconda2/lib/python2.7/site-packages/notebook/notebookapp.py", line 837, in init_configurables
    parent=self,
  File "/home/s77/anaconda2/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 19, in __init__
    specs = self.find_kernel_specs() or {}
  File "/home/s77/anaconda2/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 129, in find_kernel_specs
    self.conda_info = self._conda_info()
  File "/home/s77/anaconda2/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 29, in _conda_info
    p = subprocess.check_output(["conda", "info", "--json"]
  File "/home/s77/anaconda2/lib/python2.7/subprocess.py", line 567, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "/home/s77/anaconda2/lib/python2.7/subprocess.py", line 711, in __init__
    errread, errwrite)
  File "/home/s77/anaconda2/lib/python2.7/subprocess.py", line 1343, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

0

There is a workaround/fix for this.  It's described at https://github.com/ContinuumIO/anaconda-issues/issues/921 and comes down to needing a couple more packages being installed.  I don't know if it's a perfectly general solution, but it did work for me.  Thanks to JetBrains support for passing the link on to me.

0

请先登录再写评论。