{"action":"created","issue":{"url":"https://api.github.com/repos/ContinuumIO/anaconda-issues/issues/877","repository_url":"https://api.github.com/repos/ContinuumIO/anaconda-issues","labels_url":"https://api.github.com/repos/ContinuumIO/anaconda-issues/issues/877/labels{/name}","comments_url":"https://api.github.com/repos/ContinuumIO/anaconda-issues/issues/877/comments","events_url":"https://api.github.com/repos/ContinuumIO/anaconda-issues/issues/877/events","html_url":"https://github.com/ContinuumIO/anaconda-issues/issues/877","id":163523066,"number":877,"title":"Command line execution of a jupyter notebook fails in default Anaconda 4.1.","user":{"login":"rtrhd","id":2615292,"avatar_url":"https://avatars.githubusercontent.com/u/2615292?v=3","gravatar_id":"","url":"https://api.github.com/users/rtrhd","html_url":"https://github.com/rtrhd","followers_url":"https://api.github.com/users/rtrhd/followers","following_url":"https://api.github.com/users/rtrhd/following{/other_user}","gists_url":"https://api.github.com/users/rtrhd/gists{/gist_id}","starred_url":"https://api.github.com/users/rtrhd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtrhd/subscriptions","organizations_url":"https://api.github.com/users/rtrhd/orgs","repos_url":"https://api.github.com/users/rtrhd/repos","events_url":"https://api.github.com/users/rtrhd/events{/privacy}","received_events_url":"https://api.github.com/users/rtrhd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"bollwyvl","id":45380,"avatar_url":"https://avatars.githubusercontent.com/u/45380?v=3","gravatar_id":"","url":"https://api.github.com/users/bollwyvl","html_url":"https://github.com/bollwyvl","followers_url":"https://api.github.com/users/bollwyvl/followers","following_url":"https://api.github.com/users/bollwyvl/following{/other_user}","gists_url":"https://api.github.com/users/bollwyvl/gists{/gist_id}","starred_url":"https://api.github.com/users/bollwyvl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bollwyvl/subscriptions","organizations_url":"https://api.github.com/users/bollwyvl/orgs","repos_url":"https://api.github.com/users/bollwyvl/repos","events_url":"https://api.github.com/users/bollwyvl/events{/privacy}","received_events_url":"https://api.github.com/users/bollwyvl/received_events","type":"User","site_admin":false},"assignees":[{"login":"bollwyvl","id":45380,"avatar_url":"https://avatars.githubusercontent.com/u/45380?v=3","gravatar_id":"","url":"https://api.github.com/users/bollwyvl","html_url":"https://github.com/bollwyvl","followers_url":"https://api.github.com/users/bollwyvl/followers","following_url":"https://api.github.com/users/bollwyvl/following{/other_user}","gists_url":"https://api.github.com/users/bollwyvl/gists{/gist_id}","starred_url":"https://api.github.com/users/bollwyvl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bollwyvl/subscriptions","organizations_url":"https://api.github.com/users/bollwyvl/orgs","repos_url":"https://api.github.com/users/bollwyvl/repos","events_url":"https://api.github.com/users/bollwyvl/events{/privacy}","received_events_url":"https://api.github.com/users/bollwyvl/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-07-02T15:30:19Z","updated_at":"2016-07-05T15:54:05Z","closed_at":null,"body":"Command line execution of a jupyter notebook with `jupyter nbconvert --to notebook --execute` fails after upgrading to Anaconda 4.1.\r\n\r\nOn saving a jupyter ipython notebook the kernel name is changed from the conventional `python2` or `python3` to the conda specific form `Python [Root]` but this is not recognised by `nbconvert`.\r\n\r\nThis form is also not recognised when the notebook is opened in the browser in an Anaconda 4.0 installation causing problems sharing notebooks.\r\n \r\nThe behaviour was observed on OSX/3.5 and Linux/2.7.\r\n\r\nExplicit removal of the package `nb_conda_kernels` resolves the problem,  but this package is included by default in Anaconda 4.1.\r\n\r\n```\r\njupyter nbconvert --to notebook --execute test_python_root.ipynb\r\n[NbConvertApp] Converting notebook test_python_root.ipynb to notebook\r\n[NbConvertApp] Executing notebook with kernel: Python [Root]\r\nTraceback (most recent call last):\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/jupyter_client/kernelspec.py\", line 173, in get_kernel_spec\r\n    resource_dir = d[kernel_name.lower()]\r\nKeyError: 'python [root]'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/ron/anaconda3/bin/jupyter-nbconvert\", line 6, in <module>\r\n    main()\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/jupyter_core/application.py\", line 267, in launch_instance\r\n    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/traitlets/config/application.py\", line 596, in launch_instance\r\n    app.start()\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py\", line 293, in start\r\n    self.convert_notebooks()\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py\", line 457, in convert_notebooks\r\n    self.convert_single_notebook(notebook_filename)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py\", line 428, in convert_single_notebook\r\n    output, resources = self.export_single_notebook(notebook_filename, resources, input_buffer=input_buffer)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/nbconvertapp.py\", line 357, in export_single_notebook\r\n    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/exporter.py\", line 165, in from_filename\r\n    return self.from_file(f, resources=resources, **kw)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/exporter.py\", line 183, in from_file\r\n    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/notebook.py\", line 26, in from_notebook_node\r\n    nb_copy, resources = super(NotebookExporter, self).from_notebook_node(nb, resources, **kw)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/exporter.py\", line 130, in from_notebook_node\r\n    nb_copy, resources = self._preprocess(nb_copy, resources)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/exporters/exporter.py\", line 302, in _preprocess\r\n    nbc, resc = preprocessor(nbc, resc)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/preprocessors/base.py\", line 47, in __call__\r\n    return self.preprocess(nb,resources)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/nbconvert/preprocessors/execute.py\", line 141, in preprocess\r\n    cwd=path)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/jupyter_client/manager.py\", line 429, in start_new_kernel\r\n    km.start_kernel(**kwargs)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/jupyter_client/manager.py\", line 230, in start_kernel\r\n    kernel_cmd = self.format_kernel_cmd(extra_arguments=extra_arguments)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/jupyter_client/manager.py\", line 170, in format_kernel_cmd\r\n    cmd = self.kernel_spec.argv + extra_arguments\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/jupyter_client/manager.py\", line 82, in kernel_spec\r\n    self._kernel_spec = self.kernel_spec_manager.get_kernel_spec(self.kernel_name)\r\n  File \"/Users/ron/anaconda3/lib/python3.5/site-packages/jupyter_client/kernelspec.py\", line 175, in get_kernel_spec\r\n    raise NoSuchKernel(kernel_name)\r\njupyter_client.kernelspec.NoSuchKernel: No such kernel named Python [Root]\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/ContinuumIO/anaconda-issues/issues/comments/230520226","html_url":"https://github.com/ContinuumIO/anaconda-issues/issues/877#issuecomment-230520226","issue_url":"https://api.github.com/repos/ContinuumIO/anaconda-issues/issues/877","id":230520226,"user":{"login":"bollwyvl","id":45380,"avatar_url":"https://avatars.githubusercontent.com/u/45380?v=3","gravatar_id":"","url":"https://api.github.com/users/bollwyvl","html_url":"https://github.com/bollwyvl","followers_url":"https://api.github.com/users/bollwyvl/followers","following_url":"https://api.github.com/users/bollwyvl/following{/other_user}","gists_url":"https://api.github.com/users/bollwyvl/gists{/gist_id}","starred_url":"https://api.github.com/users/bollwyvl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bollwyvl/subscriptions","organizations_url":"https://api.github.com/users/bollwyvl/orgs","repos_url":"https://api.github.com/users/bollwyvl/repos","events_url":"https://api.github.com/users/bollwyvl/events{/privacy}","received_events_url":"https://api.github.com/users/bollwyvl/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T15:54:05Z","updated_at":"2016-07-05T15:54:05Z","body":"In the near term, the kernel_name (in the current environment) can be specified at the CLI:\r\n```\r\njupyter nbconvert Notebook.ipynb --to=html --ExecutePreprocessor.kernel_name=python\r\n```\r\n\r\nIdeally, we'd be able to overload the kernel manager in nbconvert as we have done in the notebook. However, it looks like there is no way to override the kernel discovery of the `--execute` flag with configuration. \r\n\r\nIn the case of root, we should likely not append the name... or better still, figure out a less-invasive way to do it."}}
{"actor":{"display_login":"bollwyvl"}}