jupyter-widgets-contrib / ipytree

A Tree Widget using Jupyter-widgets protocol and jsTree
MIT License
130 stars 27 forks source link

Trees do not render - MIME type mismatch? #41

Closed EnronEvolved closed 4 years ago

EnronEvolved commented 4 years ago

I seem to be having some issues getting trees in the examples to render in Jupyter Notebook 6.0.3.

Crux of the issue, after reinstalling both Jupyter (through the Linux Mint package manager) and ipytree (through pip), looks to be this error message: The resource from “http://localhost:8888/static/ipytree.js?v=20201021184001” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

The tree then fails to load due to not having a model, which I presume would be provided by ipytree.js...

When running a cell, this error appears in the Javascript console and no tree appears in the output of the cell. I am accessing the notebook through Firefox 82, with the examples on the master branch. Pip appears to be installing things in the right location, as I have used it to fix import errors with other modules. Is this an ipytree issue?

martinRenou commented 4 years ago

Can you run whereis jupyter and whereis pip and show us the output?

I suspect your installation is broken, having both installed from the Linux Mint package manager and from pip. It's advised to use virtual envs with pip, or even better use conda environment (using miniconda for example).

EnronEvolved commented 4 years ago

Whereis for Jupyter: /usr/bin/jupyter /etc/jupyter /usr/share/jupyter /usr/share/man/man1/jupyter.1.gz

Whereis for pip3: /usr/bin/pip3 /usr/share/man/man1/pip3.1.gz

I have only ever installed Jupyter through the Software Manager, but I've used pip to install other packages with no problems.

Edit: That being said, I will install Jupyter through pip and see if that resolves the issue.

martinRenou commented 4 years ago

Thanks, could you run jupyter nbextension list as well?

EnronEvolved commented 4 years ago

I decided to use Anaconda, and ipytree works fine in that environment. Closing this issue, PEBKAC.