GithubHelp home page GithubHelp logo

notablemind / jupyter-nodejs Goto Github PK

View Code? Open in Web Editor NEW
682.0 25.0 70.0 67 KB

A node.js kernel for jupyter/ipython

Home Page: http://nbviewer.ipython.org/gist/jaredly/404a36306fdee6a1737a

License: MIT License

JavaScript 99.74% Makefile 0.26%

jupyter-nodejs's People

Contributors

akosel avatar density215 avatar jaredly avatar jjwong0915 avatar kxxoling avatar kyleamathews avatar marshall007 avatar ricardofbarros avatar robynsmith avatar ryan-williams avatar thomasjm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jupyter-nodejs's Issues

Implement responding to `is_complete_request` message, to handle terminal usage

After installing jupyter-nodejs and trying it from the console, I see the following behaviour: for every command (after the first one), I have to hit Enter three times (instead of once), for the input to be accepted:

~/jupyter% jupyter console --kernel nodejs
Jupyter console 5.1.0

NodeJS For your Jupyter experience!


In [1]: x = 42Unknown message type:  is_complete_request
[0]: 9ff67a12-0b598b50bbd4c394427b35bb
[1]: <IDS|MSG>
[2]: 4ede77abe5b937111cb357d63fb45a9d7f70cef79bc65a7befcdcc7649f67e7b
[3]: {"username":"srajagopalan","msg_type":"is_complete_request","msg_id":"3b028612-846c6b527ad9ba25b16b5ed5","version":"5.0","session":"9ff67a12-0b598b50bbd4c394427b35bb","date":"2017-02-25T20:30:12.697983Z"}
[4]: {}
[5]: {}
[6]: {"code":"x = 42"}
/Users/srajagopalan/jupyter/lib/python2.7/site-packages/jupyter_console/ptshell.py:599: UserWarning: The kernel did not respond to an is_complete_request. Setting `use_kernel_is_complete` to False.
  warn('The kernel did not respond to an is_complete_request. '
In [1]: x = 42
Out[1]: 42

In [2]: x = 7
      : 
      : 
Out[2]: 7

In [3]:                                                                                                                                                                                                                                       
Do you really want to exit ([y]/n)? 
Shutting down kernel

It appears that jupyter sends an is_complete message to determine whether the input (like x = 7 above) is complete (because it may be incomplete, like f = function() {). And this kernel (jupyter-nodejs) does not support responding to the is_complete message.

Update documentation and dependencies

I just got the jupyter-nodejs notebook up and running and it looks great! There were a few bumps, and holes in the documentation along the way, so I thought I'd leave them here, in case they're useful.

  1. zmq is a dependency (for zeromq.node)
  2. the README.md is pointing to an old release, so grabbing the master branch fixed several issues
  3. need to run make at the end

I don't mind making the changes and submitting a pull request, but figured I'd check beforehand.

ES6 Javascript

This may be a non-issue, but all the Javascript for this kernel uses the ES6 / V8 language feature, import. I can't get the current version of NodeJS (v6.2.0; V8 v5.0.71.47) on Windows to recognize this keyword. Using the --harmony-module switch in kernel.json doesn't do it. Note these new language features, const, =>, and for (let aKey in pKeys) { .. } all do work.

Error: Cannot find module 'babel-runtime/core-js/get-iterator'

I've git cloned the repository, built and run the image from Dockerfile and then opened up a new Jupyter notebook. If I then add the following two cells:

%load_ext babel

%%babel
let iter = [1,2,3];
for(let x of iter){}

The following error is raised:

Error: Cannot find module 'babel-runtime/core-js/get-iterator'
    at Function.Module._resolveFilename (module.js:455:15)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at /home/jovyan/jupyter-nodejs/build/context.js:73:16
    at require (/home/jovyan/jupyter-nodejs/build/context.js:53:27)
    at Object.Contextify.sandbox.run (/home/jovyan/jupyter-nodejs/node_modules/contextify/lib/contextify.js:12:24)
    at Context.rawRun (/home/jovyan/jupyter-nodejs/build/context.js:168:23)
    at Domain.<anonymous> (/home/jovyan/jupyter-nodejs/build/context.js:188:27)
    at Domain.run (domain.js:221:14)

Cannot do `%history`

hi!

Thanks for writing this. Am new to javascript. I used to do history in ipython python kernel and get all recent commands I executed. When I try this out in your kernel:

In [20]: %history
> %history
series 1
Error: Unknown line magic: history
    at Context.lineMagic (/Users/sindhus/Downloads/package/build/context.js:96:21)
    at /Users/sindhus/Downloads/package/build/context.js:328:25
    at /Users/sindhus/Downloads/package/node_modules/async/lib/async.js:607:21
    at /Users/sindhus/Downloads/package/node_modules/async/lib/async.js:246:17
    at iterate (/Users/sindhus/Downloads/package/node_modules/async/lib/async.js:146:13)
    at async.eachSeries (/Users/sindhus/Downloads/package/node_modules/async/lib/async.js:162:9)
    at _asyncMap (/Users/sindhus/Downloads/package/node_modules/async/lib/async.js:245:13)
    at Object.mapSeries (/Users/sindhus/Downloads/package/node_modules/async/lib/async.js:228:23)
    at Object.async.series (/Users/sindhus/Downloads/package/node_modules/async/lib/async.js:605:19)
    at Context.execute (/Users/sindhus/Downloads/package/build/context.js:333:26)

Can you please fix this? Thank you.

node install.js fails because it does not create path to kernel.json

$ node install.js
fs.js:500
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory '/Users/tim/.ipython/kernels/nodejs/kernel.json'

This is because only /Users/tim/.ipython exists. It should be doing an mkdir -p on the directory path (i.e. including the keynels/nodejs part) to kernel.json.

Not sure if jupyter-nodejs is working properly...

Very new to development so sorry if this issue is handled by another component but I Googled the warning and couldn't find anything.

When I run the hello world test I receive:
In [1]: console.log('hello jupyter')Unknown message type: is_complete_request
[0]: 04334cdb-c25c-4148-a0e1-e70132136aba
[1]: <IDS|MSG>
[2]: 53570768fbac2a21f09927961431f7f42aa9e597b371fe41ebbf7e8c89389d7f
[3]: {"version":"5.0","date":"2017-02-20T18:49:54.022945","session":"04334cdb-c25c-4148-a0e1-e70132136aba","user
[4]: {}
[5]: {}
[6]: {"code":"console.log('hello jupyter')"}
/Users/212316291/anaconda/lib/python3.6/site-packages/jupyter_console/ptshell.py:571: UserWarning: The kernel di
warn('The kernel did not respond to an is_complete_request. '
In [1]: console.log('hello jupyter')
hello jupyter

When I ran "npm install && node install.js" line I get the following warning:
npm WARN package.json Dependency 'mkdirp' exists in both dependencies and devDependencies, using 'mkdirp@^0.5.1' from dependencies

Which and Version
/Users/212316291/jupyter-nodejs
==> which npm
/Users/212316291/anaconda/bin/npm

/Users/212316291/jupyter-nodejs
==> npm --version
2.14.12

My current kernel.json
{
"argv": [
"node",
"/Users/212316291/jupyter-nodejs/build/run.js",
"{connection_file}"
],
"display_name": "NodeJS",
"language": "javascript"
}

Adding babel polyfill

Babel has polyfill for supplying methods such as Array.from. However if I use

require('babel/polyfill')

It doesn't return an error, but doesn't seem to work, either. This may be a pipe dream, since I'm not sure how the notebook is being implemented. Does it seem possible for a person to use the polyfill in a notebook?

Script download bug

When I try to download an jupyter book as script it fails with: nbconvert failed: FileExtension trait 'file_extension' does not begin with a dot: 'js'

git clone fails on Windows

The clone instructions in the README fails. But git clone https://github.com/notablemind/jupyter-nodejs.git succeeds. Just an FYI.

Switch from zmq to zeromq to avoid compilation

It seems the zmq package needs to compile ZeroMQ from source which is a problem if you do not have the compilation toolchain installed. I was able to switch to the zeromq package which comes with pre-built binaries and saves you the step of having to install g++.

Is this being actively maintained?

I'm using ijavascript at the moment, but finding it quite rough around the edges. The output it prints is very unpredictable for example - sometimes it doesn't show the output from console.log commands, and it always prints the last object created, cluttering up the output. It also doesn't seem to maintain session very well across cells, sometimes necessitating a re-run of all the cells for code to work correctly. This repo looks like it has nicer output, but I wanted to check whether it's active before switching, since it isn't listed on the Jupyter site.

Any tips on debugging a script?

I have a node.js script that runs fine via the command line but not through the web notebook. I isolated it down to a single function in a third party library that I think may be at fault--but I may be wrong. Is there a way to walk through via a debugger what's happening?

Display html, using %html magic (or some other way)

I want to use the %html magic from ipython, but it seems to not exist in this kernel. And there's not list magics either (see #8). I want to use a node script that generates html, and then display it in the output cell. Is there any other way to achieve this, except magice.

Get " ‘Use’ is not a member of ‘node::Buffer’" when install

When I use "npm install && node install.js" to install jupyter-nodejs,I get a Error say this:

... ... ... ... ... ... ... ...
../node_modules/nan/nan.h:683:12: error: ‘Use’ is not a member of ‘node::Buffer’
return node::Buffer::Use(v8::Isolate::GetCurrent(), data, size);
^
make: *** [Release/obj.target/contextify/src/contextify.o] 错误 1
make:离开目录“/home/duhan/.jupyter/jupyter-nodejs/node_modules/contextify/build”
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/duhan/.nvm/versions/node/v4.1.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.13.0-61-generic
gyp ERR! command "/home/duhan/.nvm/versions/node/v4.1.2/bin/node" "/home/duhan/.nvm/versions/node/v4.1.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/duhan/.jupyter/jupyter-nodejs/node_modules/contextify
gyp ERR! node -v v4.1.2
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Linux 3.13.0-61-generic
npm ERR! argv "/home/duhan/.nvm/versions/node/v4.1.2/bin/node" "/home/duhan/.nvm/versions/node/v4.1.2/bin/npm" "install"
npm ERR! node v4.1.2
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the contextify package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls contextify
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:

npm ERR! /home/duhan/.jupyter/jupyter-nodejs/npm-debug.log

How can I do to pass the install??

require relative paths

I'm using atom with hydrogen plugin, basically is jupyter for the text editor and I have installed your package successfully and everything is working just fine.

screen shot 2015-05-27 at 15 17 20

The problem now is with require for relative paths, which I guess ipython won't know the PATH I'm on and wont pass it to node, does any one know a workaround for this?

var test = require('./test');

Error: Cannot find module './test'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.Contextify.sandbox.run (/Users/rbarros/package/node_modules/contextify/lib/contextify.js:12:24)
at Context.rawRun (/Users/rbarros/package/build/context.js:105:23)
at Context.rawEvaluate (/Users/rbarros/package/build/context.js:117:23)
at Context.execute (/Users/rbarros/package/build/context.js:194:21)
at Kernel.executeRequest (/Users/rbarros/package/build/kernel.js:153:16)
at Kernel.onShell (/Users/rbarros/package/build/kernel.js:90:14) Runtime error
Cannot find module './test'

Error: Cannot find module 'mkdirp'

~/Downloads/package$ node install
module.js:339
throw err;
^

Error: Cannot find module 'mkdirp'
at Function.Module._resolveFilename (module.js:337:15)
at Function.Module._load (module.js:287:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (/Users/csells/Downloads/package/install.js:4:14)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
~/Downloads/package$

License

Could you please choose a license to this repository?

Thank you very much for the great work!

Kind regards,

Michael

Can't install, since the folder does not exist.

This happens:

➜  package  node install.js                    
fs.js:549
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT: no such file or directory, open '/Users/sebinsua/.ipython/kernels/nodejs/kernel.json'
    at Error (native)
    at Object.fs.openSync (fs.js:549:18)
    at Object.fs.writeFileSync (fs.js:1152:15)
    at Object.<anonymous> (/Users/sebinsua/package/install.js:15:4)
    at Module._compile (module.js:428:26)
    at Object.Module._extensions..js (module.js:446:10)
    at Module.load (module.js:353:32)
    at Function.Module._load (module.js:308:12)
    at Function.Module.runMain (module.js:469:10)
    at startup (node.js:124:18)

I will create the folder manually.

Cannot require other packages (phantomjs-node) installed globally

I use the following script to install the kernel to jupyterhub , nodeJS version 4.2.6 , Jupyter 5.1 :

  cd ~
  git clone https://github.com/notablemind/jupyter-nodejs.git
  sudo mv ~/jupyter-nodejs /etc/
  cd /etc/jupyter-nodejs/
  sudo npm install 
  sudo npm run build
  sudo npm run build-ext
  cd /etc/jupyter-nodejs/
  sudo node install.js /usr/local/share/jupyter/kernels/nodejs/

Most of the functions works properly, except when I install phantomjs-node, I tried to require the this package in jupyterhub,

require('phantom');

The error message is as following:

Error: Cannot find module 'phantom'
    at Function.Module._resolveFilename (module.js:326:15)
    at Function.Module._load (module.js:277:25)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at /etc/jupyter-nodejs/build/context.js:78:16
    at require (/etc/jupyter-nodejs/build/context.js:58:27)
    at evalmachine.<anonymous>:1:1
    at Object.exports.runInContext (vm.js:44:17)
    at Context.rawRun (/etc/jupyter-nodejs/build/context.js:184:30)
    at Domain.<anonymous> (/etc/jupyter-nodejs/build/context.js:204:27)

(Updated)
I figure out the solution here, modify the kernel.json to include NODE_PATH as env:

{
  "argv": [
    "node",
    "/etc/jupyter-nodejs/build/run.js",
    "{connection_file}"
  ],
  "display_name": "NodeJS 4.3.10",
  "language": "javascript",
  "env":{
    "NODE_PATH" : "/usr/local/lib/node_modules"
  }
}

require/import packages

Where should I install packages to be accessible by my nodejs kernel ? I don't see any node_modules folder.

How to use third-party libraries?

Hello, I tried loading the following into a node.js enabled notebook and if throws errors:

%%node

const Ebay = require('ebay-node-api');

Errors (screenshot uploaded to imgur)
https://imgur.com/13vZqNV

What must I do to use third-party libraries in Jupyter like a normal script?

Cannot find module 'babel-runtime/helpers/class-call-check'

Error appears when run:

%%babel
class Awesome {
  constructor() {
    console.log('yeah!')
  }
}

in notebook after %load_ext babel.

Error: Cannot find module 'babel-runtime/helpers/class-call-check'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:20:19)
    at /home/windrunner/jupyter-nodejs/build/context.js:73:16
    at require (/home/windrunner/jupyter-nodejs/build/context.js:53:27)
    at Object.Contextify.sandbox.run (/home/windrunner/jupyter-nodejs/node_modules/contextify/lib/contextify.js:12:24)
    at Context.rawRun (/home/windrunner/jupyter-nodejs/build/context.js:168:23)
    at Domain.<anonymous> (/home/windrunner/jupyter-nodejs/build/context.js:188:27)
    at Domain.run (domain.js:228:14)

My node and npm version:

$ node -v
v5.11.1
$ npm -v
3.8.6

Unable to install due to missing pkg-config dependency

Unable to run npm install due to the following error on Mac OS:

/bin/sh: pkg-config: command not found
gyp: Call to 'pkg-config libzmq --libs' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.6.0

The fix was:

brew install pkg-config

It might be worth noting that pkg-config is required in the Prereqs section of the readme.

Can't boot kernel

After following the installation instructions:

$ ipython console --kernel nodejs
[TerminalIPythonApp] WARNING | Subcommand `ipython console` is deprecated and will be removed in future versions.
[TerminalIPythonApp] WARNING | You likely want to use `jupyter console` in the future
/Users/ryan/c/jupyter-nodejs/node_modules/bindings/bindings.js:83
        throw e
        ^

Error: dlopen(/Users/ryan/c/jupyter-nodejs/node_modules/zmq/build/Release/zmq.node, 1): Library not loaded: libzmq.3.dylib
  Referenced from: /Users/ryan/c/jupyter-nodejs/node_modules/zmq/build/Release/zmq.node
  Reason: image not found
    at Error (native)
    at Object.Module._extensions..node (module.js:440:18)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at bindings (/Users/ryan/c/jupyter-nodejs/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/Users/ryan/c/jupyter-nodejs/node_modules/zmq/lib/index.js:6:30)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
Jupyter Console 4.1.1


ERROR: Kernel did not respond

Shutting down kernel

After Jupyter Console 4.1.1 it hangs for a while and takes a few minutes before exiting. Any idea what's going wrong? I have brew installed zmq and czmq and tried the wget/mv workarounds listed here to no avail.

Modifying globals (client-side javascript)

Is there any way to modify globals as a workaround for supporting client javascript libraries (in particular) and overcoming the following error:

const jsdom = require('jsdom')
const dom = new jsdom.JSDOM()
window = dom.window
const gapi = require('gapi-client')
ReferenceError: window is not defined
    at Object.<anonymous> (jupyter-nodejs/node_modules/gapi-client/index.js:1:72)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at jupyter-nodejs/build/context.js:69:18
    at require (jupyter-nodejs/build/context.js:58:27)

Even though I've 'defined' window, I still receive ReferenceError: window is not defined. This is perhaps because we're stuck in a closure? I was under the impression javascript modified globals by default, I may just not fully understand node-js behavior. Is there a way we could support something like this or a better way to execute client-side libraries in jupyter-nodejs?

binder

It would be very cool if you could get this up and running on beta.mybinder.org...

EDIT: You could then launch the kernel at https://beta.mybinder.org/v2/gh/notablemind/jupyter-nodejs/master. It looks like your docker file is close to getting you there. Here is one that I setup for a Fortran Jupyter kernel: https://github.com/sourceryinstitute/jupyter-CAF-kernel/blob/master/prebuild/Dockerfile

It looks like you mainly may need to change to ${NB_USER}... not 100% sure, testing it as is now. I'll report back if/when the docker build finishes. The project I linked to above uses a wrapper docker file so that the main one can build on docker hub, and then binder can launch it quickly.

Printing to console from within a module

I tried to call a module from the kernel that prints to console.log. The expected text did not show in the notebook. I also need to use the display function but it is not accessible from within the module.

Here is the code of the module:

module.exports = function(){console.log('should print this');return 44;};

The output is 44 without printing the text "should print this".

Unexpected token export

I'm using the babel extension and running into the titled error still.

// In[1]:
%load_ext babel
// In[2]:
%%babel
import { get_base_url, test_successful_resp, test_required_param } from '../testlib';

Given testlib.js

const assert = require('assert');

export const get_base_url = (path) => {
	const base = process.env.DC_API_URL;

	assert.notEqual(base, undefined, 'DC_API_URL not found');
	return `${base}/beta/${path}`;
};
// more functions defined in the same manner

I would think the babel extension would resolve this but I guess I'm not understanding.

When your powers combine

I'm dealing with an internal struggle right now. There are at least 3 Jupyter kernels for node.

For IJavaScript, Nicolas Riesco extracted the messaging protocol to a separate package (https://github.com/n-riesco/jmp) so it could be used by other node applications (Electron and Atom apps e.g.). My current preference is IJavaScript because I've been using it, liked the layout, the documentation, the installation process, etc.

The juptyer-nodejs package has wonderful magics and I know you (@jaredly) as an active member of the community.

I'm torn because I'd like to refer to one kernel for Node, especially if any of them were to go up on https://try.jupyter.org.

Where do you think the differences are? What would help foster a common set of packages amongst developers?

/cc @n-riesco

dynamic path variables

ipython is not jupyter.

Would be great if the install.js and the readme
used the dynamic path variable for kernal location
mkdir -p $(jupyter --data-dir) etc

Tab completion unresponsive, raising Exception in thread Thread-4 after four times pressing tab.

Below are are the error message of testing auto-completion feature. Date. does not pop up suggestion expected.
For more information on my platforms:
Node version: 7.9.0
python3 versio: 3.5.2
OS: Linux mint 18.3

Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.5/threading.py", line 862, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.5/dist-packages/prompt_toolkit/interface.py", line 860, in run
    completions = list(buffer.completer.get_completions(document, complete_event))
  File "/usr/local/lib/python3.5/dist-packages/jupyter_console/ptshell.py", line 110, in get_completions
    cursor_pos=document.cursor_position
  File "/usr/local/lib/python3.5/dist-packages/jupyter_console/completer.py", line 39, in complete_request
    msg = self.client.shell_channel.get_msg(timeout=self.timeout)
  File "/usr/local/lib/python3.5/dist-packages/jupyter_client/blocking/channels.py", line 57, in get_msg
    raise Empty
queue.Empty```

error when installing with install.js

Here is the error message:

j@j-K401LB:~/Downloads/jupyter-nodejs-1.1.0/package$ node install.js
fs.js:500
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory '/home/j/.ipython/kernels/nodejs/kernel.json'
    at Error (native)
    at Object.fs.openSync (fs.js:500:18)
    at Object.fs.writeFileSync (fs.js:1099:15)
    at Object.<anonymous> (/home/j/Downloads/jupyter-nodejs-1.1.0/package/install.js:15:4)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)

Making the missing directory manully seems able to avoid the poblem:

mkdir -p ~/.ipython/kernels/nodejs/

jupyterlab not work!

Does it considerate compatible with jupyterlab?
I tried it works well in notebook,but not in jupyterlab。

Issues with Javascript magic

It seems Javascript magic is not recognized.

Example:
%%javascript
console.log("hello world")
==> Error, Unknown magic "javascript".

My aim in using Javascript magic is to run the following code
to enable numbering of LaTeX equations:

%%javascript
MathJax.Hub.Config({ TeX: { equationNumbers: { autoNumber: "AMS" } } });

Creating a docker image from jupyter notebook with jupyter-nodejs kernel

Hi!
Note: I am new both to jupyter and docker.
I am struggling to create a docker image from the base image: https://github.com/jupyter/notebook/ that would also contain jupyter-nodejs.
I added nodejs to the new image via ubuntu apt-get but jupyter-nodejs installation always fails in some way. Could you share some advice / help me to create such image?

I think such a docker image with nice web jupyter notebook for python and nodejs would be extremely useful.

Immediately rejected Promise kills the kernel

Hi there, loving the kernel so far! It works great with Node6 and has made presentations a breeze.

One small snag, despite best efforts catching Promise rejections, the kernel seems to die unless a setTimeout is involved. Examples!

this works:

var getHamburgerMaybe = new Promise((resolve, reject) => {
    setTimeout(() => reject("[OutOfMeatException] Where's the beef?"), 3000);
});

getHamburgerMaybe.catch(error => console.log(error));

this kills the kernel:

const p = new Promise((resolve, reject) => {
    reject();
})
.then(
    () => {
        console.log('Promise fulfilled.');
    },
    () => {
        console.log('Promise rejected');
    }
)

Any thoughts?

Throw gives unexpected results

When Node runs a "throw" in Notebook I get only
a very cryptic "null" result which makes very difficult
to trace where the error comes from.

Moreover, the web page starts to complain about that "null"
result saying : "Notebook validation failed".

Do you observer the same behaviour ?

bye
Nicola

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.