DonJayamanne / vscodeJupyter

Jupyter for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=donjayamanne.jupyter
MIT License
336 stars 34 forks source link

Cannot run Jupyter cell since pythonVSCode update #27

Closed robmurtagh closed 6 years ago

robmurtagh commented 7 years ago

Environment data

VS Code version: 1.10.2 Jupyter Extension version: 1.0.0 OS and version: macOS Sierra 10.12.3

Logs

Output from Jupyter output panel

Starting Jupyter Notebook
jupyter notebook --no-browser --port=8888 --NotebookApp.allow_origin="*"
[I 21:11:41.645 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found
[I 21:11:42.633 NotebookApp] ✓ nbpresent HTML export ENABLED
[W 21:11:42.633 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named nbbrowserpdf.exporters.pdf
[I 21:11:42.640 NotebookApp] [nb_conda] enabled
[I 21:11:42.753 NotebookApp] [nb_anacondacloud] enabled
[I 21:11:42.763 NotebookApp] Serving notebooks from local directory: /Users/robmurtagh/projects_scripts/data-preprocessor-adform
[I 21:11:42.763 NotebookApp] 0 active kernels 
[I 21:11:42.763 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/
[I 21:11:42.763 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[W 21:11:43.422 NotebookApp] 404 GET /%20/api/kernelspecs?1489093903372 (127.0.0.1) 42.94ms referer=None
[W 21:11:50.358 NotebookApp] 404 GET /%20/api/kernelspecs?1489093910351 (127.0.0.1) 1.95ms referer=None

Output from Console window (Help->Developer Tools menu)

mainThreadExtensionService.ts:116 [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.runSelectionLine` appears multiple times in the `commands` section.
mainThreadExtensionService.ts:116 [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.execCurrentCell` appears multiple times in the `commands` section.
mainThreadExtensionService.ts:116 [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.execCurrentCellAndAdvance` appears multiple times in the `commands` section.
mainThreadExtensionService.ts:116 [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.gotToPreviousCell` appears multiple times in the `commands` section.
mainThreadExtensionService.ts:116 [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.gotToNextCell` appears multiple times in the `commands` section.
mime.ts:59 Overwriting extension <<.jsx>> to now point to mime <<text/x-jsx>>
extensionHost.ts:282 [Extension Host] [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.runSelectionLine` appears multiple times in the `commands` section.
extensionHost.ts:282 [Extension Host] [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.execCurrentCell` appears multiple times in the `commands` section.
extensionHost.ts:282 [Extension Host] [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.execCurrentCellAndAdvance` appears multiple times in the `commands` section.
extensionHost.ts:282 [Extension Host] [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.gotToPreviousCell` appears multiple times in the `commands` section.
extensionHost.ts:282 [Extension Host] [/Users/robmurtagh/.vscode/extensions/donjayamanne.python-0.6.0]: Command `jupyter.gotToNextCell` appears multiple times in the `commands` section.
messageService.ts:126 Notebook not selected/startede.doShow @ messageService.ts:126
nativeKeymap.ts:320 'KeyboardEvent.keyIdentifier' is deprecated and will be removed in M54, around October 2016. See https://www.chromestatus.com/features/5316065118650368 for more details.
2messageService.ts:126 <!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">

    <title>Jupyter Notebook</title>
    <link rel="shortcut icon" type="image/x-icon" href="/static/base/images/favicon.ico?v=30780f272ab4aac64aa073a841546240">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <link rel="stylesheet" href="/static/components/jquery-ui/themes/smoothness/jquery-ui.min.css?v=9b2c8d3489227115310662a343fce11c" type="text/css" />
    <link rel="stylesheet" href="/static/components/jquery-typeahead/dist/jquery.typeahead.min.css?v=7afb461de36accb1aa133a1710f5bc56" type="text/css" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="/static/style/style.min.css?v=f6c09475baf6beabd41f8fe518601204" type="text/css"/>

<style type="text/css">
/* disable initial hide */
div#header, div#site {
    display: block;
}
</style>

    <link rel="stylesheet" href="/custom/custom.css" type="text/css" />
    <script src="/static/components/es6-promise/promise.min.js?v=f004a16cb856e0ff11781d01ec5ca8fe" type="text/javascript" charset="utf-8"></script>
    <script src="/static/components/requirejs/require.js?v=6da8be361b9ee26c5e721e76c6d4afce" type="text/javascript" charset="utf-8"></script>
    <script>
      require.config({

          urlArgs: "v=20170309211141",

          baseUrl: '/static/',
          paths: {
            'auth/js/main': 'auth/js/main.min',
            custom : '/custom',
            nbextensions : '/nbextensions',
            kernelspecs : '/kernelspecs',
            underscore : 'components/underscore/underscore-min',
            backbone : 'components/backbone/backbone-min',
            jquery: 'components/jquery/jquery.min',
            bootstrap: 'components/bootstrap/js/bootstrap.min',
            bootstraptour: 'components/bootstrap-tour/build/js/bootstrap-tour.min',
            'jquery-ui': 'components/jquery-ui/ui/minified/jquery-ui.min',
            moment: 'components/moment/moment',
            codemirror: 'components/codemirror',
            termjs: 'components/term.js/src/term',
            typeahead: 'components/jquery-typeahead/dist/jquery.typeahead'
          },
      map: { // for backward compatibility
        "*": {
        "jqueryui": "jquery-ui",
        }
      },
          shim: {
            typeahead: {
              deps: ["jquery"],
              exports: "typeahead"
            },
            underscore: {
              exports: '_'
            },
            backbone: {
              deps: ["underscore", "jquery"],
              exports: "Backbone"
            },
            bootstrap: {
              deps: ["jquery"],
              exports: "bootstrap"
            },
            bootstraptour: {
              deps: ["bootstrap"],
              exports: "Tour"
            },
            "jquery-ui": {
              deps: ["jquery"],
              exports: "$"
            }
          },
          waitSeconds: 30,
      });

      require.config({
          map: {
              '*':{
                'contents': 'services/contents',
              }
          }
      });

      define("bootstrap", function () {
          return window.$;
      });

      define("jquery", function () {
          return window.$;
      });

      define("jqueryui", function () {
          return window.$;
      });

      define("jquery-ui", function () {
          return window.$;
      });
      // error-catching custom.js shim.
      define("custom", function (require, exports, module) {
          try {
              var custom = require('custom/custom');
              console.debug('loaded custom.js');
              return custom;
          } catch (e) {
              console.error("error loading custom.js", e);
              return {};
          }
      })
    </script>

</head>

<body class="" >

<noscript>
    <div id='noscript'>
      Jupyter Notebook requires JavaScript.<br>
      Please enable it to proceed.
  </div>
</noscript>

<div id="header">
  <div id="header-container" class="container">
  <div id="ipython_notebook" class="nav navbar-brand pull-left"><a href="/tree" title='dashboard'><img src='/static/base/images/logo.png?v=7c4597ba713d804995e8f8dad448a397' alt='Jupyter Notebook'/></a></div>

  </div>
  <div class="header-bar"></div>

</div>

<div id="site">

<div class="error">

    <h1>404 : Not Found</h1>

<p>You are requesting a page that does not exist!</p>

</header>

</div>

</body>

</html>

Actual behavior

Cannot run a Jupyter cell in python since pythonVSCode update.

Expected behavior

Run a Jupyter cell. It used to work fine when vscodeJupyter was part of pythonVSCode, but since I updated my python plugin, and got the deprecation notice, it's broken.

DonJayamanne commented 7 years ago

What version of Jupyter are you using?
Please could you try to uninstall Jupyter extension and try.
Also could you update Jupyter to the latest version.

robmurtagh commented 7 years ago

I'm on Jupyter 1.0.0. Looks like this is the latest version: https://pypi.python.org/pypi/jupyter

When I uninstall Jupyter extension and run a cell it says:

Deprecated: Please install the new Jupyter extension. Jupyter functionality within this extension has been deprecated.

On reinstalling Jupyter extension, symptoms are the same.

Thanks for the advice!

DonJayamanne commented 7 years ago

When you get the message, just ignore it, don't re-install it.

robmurtagh commented 7 years ago

Ah, I've found a workaround. If I go:

For some reason setting the notebook manually fixes it?

DonJayamanne commented 7 years ago

hmm... interesting. it should have been picked up automatically. Oh well, thanks

robmurtagh commented 7 years ago

Np, thanks for your work on the extension.

On the first run, once I've started a notebook, when I go to 'Jupyter: Enter the URL of a local/remote Jupyter notebook', my notebook address is already there. It's as if it just hasn't been 'Entered'.

Btw, would it ever be possible to attach the VSCode debugger to a Jupyter cell? I guess since the commands are actually being executed remotely, this might be tricky right?

Thanks

DonJayamanne commented 7 years ago

Unfortunately no, at this stage it isn't possible to debug the execution of code within the jupyter environment.