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

missing files for install & module loading error at runtime #6

Closed
bertrandrigaud opened this issue May 31, 2017 · 9 comments
Closed

Comments

@bertrandrigaud
Copy link

I tried to install firefly_widgets from the git repo without success. It seems files are missing:
rebuilding js and css failed
missing files: ['/PATH/firefly_widgets/firefly_widgets/static/extension.js', '/PATH/firefly_widgets/firefly_widgets/static/index.js']

Then I tried to install it from the pip repo, and it worked fine (files are in the tar.gz of the pip repo)
but when I tried to run a sample code:

firefly_widget

Any idea ?

@stargaser
Copy link
Collaborator

@bertrandrigaud Thank you for trying this out and making an issue. When you installed from GitHub, did you follow all the steps for a developer installation?

The .js files in the static directory are generated by compiling the Javascript with npm. So they are excluded from GitHub in the .gitignore.

When installing via pip, did you use "pip install" or did you unpack the tarfile and use the contents? I tested "pip install" once into a conda environment, and it worked then, but perhaps the Jupyter setup steps are putting information outside the conda environments.

@bertrandrigaud
Copy link
Author

Whoops ! I did'nt went that far in the github procedure... my fault.
But I finally installed it with pip install command. In the notebook, I can import firefly_widget, but I get this message when I run "fv" cell. In the past I managed to play with firefly_widget... What is different is that I run it on a more recent version of jupyter notebook, ipywiget, widgetnbextension... I have to mention that I'm also on a conda environment and python version is 3.6. I wonder if the key is in ipywidget new version (6.0.0) ?

@stargaser
Copy link
Collaborator

The version on pip was developed with ipywidgets 6.0.0. I am also running with notebook version 5.0.0 and widgetsnbextension 2.0.0, but python 3.5. I don't think the difference between python 3.5 and 3.6 will make a difference but I am checking on that.

I have seen the "Could not create model" message when something went wrong in the code. I think helpful information may be contained in the Javascript console (right-click Inspect in Chrome, right-click Inspect Element in Safari and Firefox, then select Console tab). You might see Uncaught Error: firefly has not been bootstrapped but the widgets should run in spite of that. Are there other error messages in the console?

@stargaser
Copy link
Collaborator

I have made a new python=3.6 conda environment and pip-installed firefly_client into it. I am able to reproduce your problem with the "Could not create model" message. I am seeing an error Failed to load resource: net::ERR_UNKNOWN_URL_SCHEME in firefly_loader.js.

Also, after the initial pip installation, the jupyter nbextension enable --py --sys-prefix firefly_widgets step failed when trying to import numpy. I had to install astropy, jupyter, ipywidgets using conda for the "jupyter nbextension enable" to run successfully.

@stargaser
Copy link
Collaborator

Update: the above error was caused by incorrectly typing connect('irsa.ipac.caltech.edu:80/irsaviewer') instead of connect('http://irsa.ipac.caltech.edu:80/irsaviewer') in the first cell. Now it is working for me.

@bertrandrigaud
Copy link
Author

work in progress... Today I tried to run a simple notebook server on my machine and I ran it sucessfully with py3.5 and py3.6.
my use case is in fact a jupyterhub running on a remote vm using https. when I try to connect to :

from firefly_widgets import connect
connect('http://irsa.ipac.caltech.edu:80/irsaviewer')
It's blocked by my web browser because of "mixed content http/https". Ok fine, I have a firefly server running on another remote vm with https. But it still does'nt work...

here is the console log:
Using //@ to indicate sourceMappingURL pragmas is deprecated. Use //# instead main.min.js:1:0
L'utilisation des « Mutation Events » est obsolète. Utiliser « MutationObserver » à la place. main.min.js:5:7259
L'utilisation de « getPreventDefault() » est obsolète. Utiliser « defaultPrevented » à la place. main.min.js:5:12747
actions jupyter-notebook:find-and-replace does not exist, still binding it in case it will be defined later... main.min.js:33264:17
accessing "actions" on the global IPython/Jupyter is not recommended. Pass it to your objects contructors at creation time main.min.js:36572:11
load_extensions Arguments { , 4 de plus… } main.min.js:12429:9
Loading extension: jupyter-firefly/extension main.min.js:12406:21
Widgets are not available. Please install widgetsnbextension or ipywidgets 4.0 main.min.js:36594:17
Session: kernel_created (f72dfb4a-02dd-4340-b1a0-67e646106e13) main.min.js:24777:13
Starting WebSockets: "wss://ccosvm1009/user/bertrand/api/kernels/96af2dc6-7646-4e82-9859-2ad5a6670e2a" main.min.js:23933:9
mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create firefly-b5b570854eac7439e5c0.js:152:10034
"Connecting to wss://ccosvmlsst028/firefly//sticky/firefly/events" firefly-b5b570854eac7439e5c0.js:46:26739
WebSocket connected. connId:1d channel:39f8b43f-50b5-41cb-8f5c-73c9840e63d6 firefly-b5b570854eac7439e5c0.js:46:27571
Kernel: kernel_connected (96af2dc6-7646-4e82-9859-2ad5a6670e2a) main.min.js:23577:13
Kernel: kernel_ready (96af2dc6-7646-4e82-9859-2ad5a6670e2a) main.min.js:23577:13
GET
https://ccosvmlsst028/firefly/firefly_loader.js [HTTP/1.1 200 OK 10 ms]
GET
https://ccosvmlsst028/firefly/firefly-b5b570854eac7439e5c0.js [HTTP/1.1 200 OK 0 ms]
Could not open comm -- Error: Class jupyter.widget not found in registry
Trace de la pile :
load_class/<@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:13243:28
load_class@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:13228:1
CommManager.prototype.comm_open@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:23217:31
.proxy/i@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:4:5486
Kernel.prototype._handle_iopub_message@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24697:20
Kernel.prototype._finish_ws_message@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24489:1
Kernel.prototype._handle_ws_message/this._msg_queue<@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24480:39
main.min.js:13279:17

Couldn't process kernel message Object { fileName: "https://ccosvm1009/user/bertrand/st…", lineNumber: 13198, columnNumber: 19, message: "Could not open comm", error_stack: Array[2], stack: "" } main.min.js:24481:34

Could not open comm -- Error: Class jupyter.widget not found in registry
Trace de la pile :
load_class/<@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:13243:28
load_class@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:13228:1
CommManager.prototype.comm_open@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:23217:31
.proxy/i@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:4:5486
Kernel.prototype._handle_iopub_message@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24697:20
Kernel.prototype._finish_ws_message@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24489:1
Kernel.prototype._handle_ws_message/this._msg_queue<@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24480:39
main.min.js:13279:17

Couldn't process kernel message Object { fileName: "https://ccosvm1009/user/bertrand/st…", lineNumber: 13198, columnNumber: 19, message: "Could not open comm", error_stack: Array[2], stack: "" } main.min.js:24481:34

Couldn't process kernel message Object { fileName: "https://ccosvm1009/user/bertrand/st…", lineNumber: 13198, columnNumber: 19, message: "Could not open comm", error_stack: Array[2], stack: "" } main.min.js:24481:34

Error: firefly has not been bootstrapped
firefly-b5b570854eac7439e5c0.js:49:23901
GET
XHR
https://ccosvm1009/user/bertrand/api/contents/Images%20and%20TablesTest.ipynb [HTTP/1.1 200 OK 56 ms]
PUT
XHR
https://ccosvm1009/user/bertrand/api/contents/Images%20and%20TablesTest.ipynb [HTTP/1.1 200 OK 218 ms]
GET
XHR
https://ccosvm1009/user/bertrand/api/contents/Images%20and%20TablesTest.ipynb [HTTP/1.1 200 OK 67 ms]
PUT
XHR
https://ccosvm1009/user/bertrand/api/contents/Images%20and%20TablesTest.ipynb [HTTP/1.1 200 OK 220 ms]
GET
https://ccosvmlsst028/firefly/firefly_loader.js [HTTP/1.1 200 OK 10 ms]
GET
https://ccosvmlsst028/firefly/firefly-b5b570854eac7439e5c0.js [HTTP/1.1 200 OK 0 ms]
Could not open comm -- Error: Class jupyter.widget not found in registry
Trace de la pile :
load_class/<@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:13243:28
load_class@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:13228:1
CommManager.prototype.comm_open@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:23217:31
.proxy/i@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:4:5486
Kernel.prototype._handle_iopub_message@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24697:20
Kernel.prototype._finish_ws_message@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24489:1
Kernel.prototype._handle_ws_message/this._msg_queue<@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24480:39
main.min.js:13279:17

Couldn't process kernel message Object { fileName: "https://ccosvm1009/user/bertrand/st…", lineNumber: 13198, columnNumber: 19, message: "Could not open comm", error_stack: Array[2], stack: "" } main.min.js:24481:34

Could not open comm -- Error: Class jupyter.widget not found in registry
Trace de la pile :
load_class/<@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:13243:28
load_class@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:13228:1
CommManager.prototype.comm_open@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:23217:31
.proxy/i@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:4:5486
Kernel.prototype._handle_iopub_message@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24697:20
Kernel.prototype._finish_ws_message@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24489:1
Kernel.prototype._handle_ws_message/this._msg_queue<@https://ccosvm1009/user/bertrand/static/notebook/js/main.min.js?v=6a166b31c5a20f809e44ec2d50e40412:24480:39
main.min.js:13279:17

Couldn't process kernel message Object { fileName: "https://ccosvm1009/user/bertrand/st…", lineNumber: 13198, columnNumber: 19, message: "Could not open comm", error_stack: Array[2], stack: "" } main.min.js:24481:34

Couldn't process kernel message Object { fileName: "https://ccosvm1009/user/bertrand/st…", lineNumber: 13198, columnNumber: 19, message: "Could not open comm", error_stack: Array[2], stack: "" } main.min.js:24481:34

Error: firefly has not been bootstrapped
firefly-b5b570854eac7439e5c0.js:49:23901
GET
XHR
https://ccosvm1009/user/bertrand/api/contents/Images%20and%20TablesTest.ipynb [HTTP/1.1 200 OK 57 ms]
PUT
XHR
https://ccosvm1009/user/bertrand/api/contents/Images%20and%20TablesTest.ipynb [HTTP/1.1 200 OK 203 ms]

I'm still investigating.

@bertrandrigaud
Copy link
Author

Reinstalled from scratch using only conda install command (not pip, except firefly_widgets of course). Works like a charm! Just a comment on the sample code:
AttributeErrorTraceback (most recent call last)
in ()
----> 1 iv.x_pan

AttributeError: 'ImageViewer' object has no attribute 'x_pan'
while y_pan seems to work...

@stargaser
Copy link
Collaborator

Great that it works with conda installs of the other packages!

x_pan and y_pan, along with zoom, were added from a branch that was merged to master on May 31. It's not on pip yet. I'll increment the version and update the pip package.

@bertrandrigaud
Copy link
Author

Alright! Thanks for the help ;)
Before closing the issue, to sum up:

  • install all jupyter stuff using conda install/upgrade
  • be careful with mixed content (https/http)

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

No branches or pull requests

2 participants