Python Forum

Full Version: "Widget Javascript not detected" error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a Python script that I'm attempting to run; it includes the use of a widget. The relevant code is:

from my_widget import *

# {code to generate "results" data}

net = Network(my_widget)
net.load_df(results)
net.widget()
However, the final line is causing a problem, returning the error message:

Error:
net.widget() Widget Javascript not detected. It may not be installed or enabled properly.
I located the following relevant thread that addresses this error:

Widget Javascript not detected
https://github.com/jupyter-widgets/ipywi...issues/541

From the advice given in that thread, I have successfully executed both of the following lines in my Anaconda prompt opened as administrator:

jupyter nbextension enable --py --sys-prefix widgetsnbextension

jupyter nbextension enable --py widgetsnbextension
However, even after closing out of my Spyder editor and restarting to ensure that these updates have registered, this has not resolved this error message.

I've also created a Jupyter Notebook with this code to see if the behavior is different; when I run the cell above, I get the different error message:

Error:
Could not create model: Model name hello_model Model module my_widget Model module version * Script error for "my_widget" http://requirejs.org/docs/errors.html#scripterror
Any suggestions about how I might resolve this error message will be much appreciated. Thanks!!