Skip to content

The MyBinder launch on the main page doesn't seem to produce a working session #284

@fomightez

Description

@fomightez

I am seeing current launches from the 'launch binder' badge on the main page fail to produce a session where VPython works in notebooks. (Shows the error that is featured in this open issue entitled "AttributeError: module 'notebook' has no attribute 'nbextensions'".)

I am unclear exactly why it doesn't work since the Python version in the session is within the range I see here listed as working. (There says Python 3.8 through 3.12 and it seems the launch from the badge is 3.10.) Additionally, VPython does indeed work in notebooks via sessions served by the MyBinder service if you just install it in standard session launched from the JupyterLab repo using %pip install vpython and restart the kernel and do a hard refresh on the notebook page before trying. (In Mac Chrome, the key combination for the hard refresh is Command+Shift+R.) (Technical note on Python version: the MyBinder-served session that I got from the JupyterLab repo currently launches with Python 3.12.12.) However, that process is probably only a viable option for advanced users.
Given that, along with being unsure of the exact issue or what is the current way the developers may want to tackle this, I offer a workaround for those wishing to use MyBinder-served sessions with VPython for now.

Offered workaround for now:

I updated my fork to be current and, importantly, result in launches that at this time has VPython working in Jupyter Notebooks served via the MyBinder service:
https://github.com/fomightez/vpython-jupyter/tree/master

You can launch a session from here with this badge:
Binder


Further Details for the Developers or those considering implementing there own repos to offer VPython

What is needed to do this at this time is much less than the detailed requirements listed here, see https://github.com/fomightez/vpython-jupyter/blob/master/binder/environment.yml . (Even that list could have been simpler; however, I wanted some packages I commonly use to be present.) I put my environment.yml in a binder subdirectory to keep it separate from any directives the root directory may have; MyBinder / Binder resources use that preferentially. My environment.yml is specifying for conda to install VPython from the conda-forge channel. So in essence the the repo content outside of the binder subdirectory is only used as a source of the test notebooks. If this wasn't a fork of the main VPython development (I believe), I could have made a streamlined repo with just the environment.yml in root (or a binder subdirectory) and pulled in the test notebooks from the https://github.com/vpython/vpython-jupyter/ repo using start/postBuild`) post-build actions configuration file, similar to what I do here, here, & here. This allows the content to be separate from the repo specifying the environment for the Binder / MyBinder sessions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions