bollwyvl / nb-mermaid

DEPRECATED Mermaid diagrams in the Jupyter Notebook
https://bollwyvl.github.io/nb-mermaid
BSD 3-Clause "New" or "Revised" License
36 stars 19 forks source link

Javascript error adding output! SyntaxError: Unexpected token import See your browser Javascript console for more details. #6

Open shivam6294 opened 7 years ago

shivam6294 commented 7 years ago

Fails when running the following code for activating nb-mermaid:

%%javascript
import notebook
notebook.nbextensions.check_nbextension('nb-mermaid',user=True)
require(['base/js/utils'],
function(utils) {
        utils.load_extensions('nb-mermaid/nb-mermaid');
});

Results in error:

Javascript error adding output!
SyntaxError: Unexpected token import
See your browser Javascript console for more details.

Using Anaconda's 64 bit distribution of Python 3.5 on Ubuntu 16.04

shivam6294 commented 7 years ago

Also, installing nb-mermaid crashes the python kernel, and does not allow it to restart ... had to reinstall anaconda

xiaofanglegoc commented 6 years ago

I have the same problem as @shivam6294 ,

hagrid67 commented 6 years ago

I got a similar problem with the pip install breaking ipython.

First I got a warning during the pip install nb-mermaid:

Installing collected packages: IPython, nb-mermaid
  Found existing installation: ipython 6.1.0
    DEPRECATION: Uninstalling a distutils installed project (IPython) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling ipython-6.1.0:
      Successfully uninstalled ipython-6.1.0
Successfully installed IPython-3.2.3 nb-mermaid-0.1.0

After this, running ipython gave an error:

  File "/home/jeremy/miniconda3/envs/opensim-rl/lib/python3.6/site-packages/IPython/utils/text.py", line 28, in <module>
    from IPython.external.path import path
ImportError: cannot import name 'path'

Fixed ipython easily enough with pip install ipython -U (which took it to 6.2.1), though not sure yet whether this has completely fixed it.

References: path.py error Related error from pickleshare - has comments from core jupyter / ipython developers.

I'm also using anaconda 3 here (something which I find something of a black box compared to pip)

everitt257 commented 6 years ago

Same issue as above, also using Anaconda's 64 bit distribution. Had to pip uninstall ipykernel and pip install ipykernel to get jupyter notebook working again.