Hi,This has been on the to-do list few several months now...we can't run vpython >=7.5 on binder because it blocks the websocket server that we set up.
I think the solution is to use https://jupyter-server-proxy.readthedocs.io/en/latest/ but haven't had time to try it.Matt Craig
ws = new WebSocket("ws://localhost:" + port + uri);var port = 51929
+ var url = 'wss://' + document.location.hostname + document.location.pathname + '/chat';
+ websocket = new WebSocket(url);
| ws = new WebSocket("ws://localhost:" + port + uri); |
"If he tells the students to use jupyter, there will be a lot of hassle about how to install this on everybody's laptop under different operating systems; so he would prefer to use jupyterhub and just tell his students to open a browser and log in with their university account and start doing stuff."This is a situation where glowscript.org or trinket.io is the appropriate environment. These students almost certainly don't need access to the world of Python modules, so the inability to access such modules is not a problem. A student can simply log in to one of these web sites and program, using VPython.
So you will need to wait until the next release of vpython which should be version 7.5.2 . After you install that version on JupyterHub the students should be able to log into their university account and run vpython programs in a jupyter notebook.One thing to consider when using vpython on JupyterHub is to enable websocket compression which is a configurable attribute in the jupyter_notebook_config.py file. See the attribute websocket_compression_options inTo enable websocket compression it should be set toc.NotebookApp.websocket_compression_options = {}in the jupyter_notebooi_config.py file in your JupyterHub installation. But this will turn on websocket compression for all notebooks running on the JupyterHub not just for vpython.
NameError: name 'sphere' is not definedif you have a file named vpython.py in your current directory or path that isn't the vpython.py file from the vpython package.
John
Go to this download site and click Download.
Unzip the GlowScriptOffline package to any convenient place on your computer.
Inside the GlowScriptOffline folder, read the README file to learn how to use the package.