Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter Lab: neo4jupyter.init_notebook_mode() -> Javascript Error: require is not defined #7

Open
pwrose opened this issue Feb 13, 2020 · 7 comments
Labels
Milestone

Comments

@pwrose
Copy link

pwrose commented Feb 13, 2020

neo4jupyter (v 0.1.2) doesn't seem to work in Jupyter Lab:

import neo4jupyter
neo4jupyter.init_notebook_mode()

Javascript Error: require is not defined

@merqurio
Copy link
Owner

I'll check it out, thanks !
Can you check the jupyterlab version ?

@merqurio merqurio added the bug label Feb 13, 2020
@pwrose
Copy link
Author

pwrose commented Feb 13, 2020 via email

@merqurio
Copy link
Owner

merqurio commented Mar 4, 2020

Thanks ! I'll try to check it this weekend

@merqurio merqurio added this to the 0.2.0 milestone Mar 10, 2020
@pwrose
Copy link
Author

pwrose commented Mar 20, 2020

@merqurio we are trying to use neo4jupyter for our coronavirus KG. If you have a chance, could you look into the 0.2.0 milestones? You could save a life!

@DoubleBite
Copy link

@pwrose Using jupyter notebook instead of jupyter lab may work

@pwrose
Copy link
Author

pwrose commented Jun 11, 2020 via email

@bucweat
Copy link

bucweat commented Jul 27, 2020

Just ran into this myself. Turns out Jupyterlab does not include require.js while jupyter does. Jupyterlab folks didn't want developers using require.js to load dependencies, so they left it out and don't plan on adding it back. They recommended adding a lab extension. Someone did make a requirejs lab extension for jupyterlab but it only works on older versions.

Easy fix is to copy require.js to the same directory that has your ipynb file and then

%%HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.js"></script>

in a cell before you

import neo4jupyter
neo4jupyter.init_notebook_mode()

Originally I thought you could copy the file locally and do the following to import it, but this does not work

%%HTML
<script src="require.js"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants