VPython in JupyterLab not rendering

240 views
Skip to first unread message

John Burk

unread,
Apr 2, 2019, 5:07:42 AM4/2/19
to VPython-users
I've installed a VPython 7.5 using the command conda install -c vpython vpython to a clean anaconda environment running python 3.6. When I open Jupyterlab (0.35.4) and try to run a program to render a sphere, the sphere() command hangs and no window appears.

Screen Shot 2019-04-02 at 11.06.17 AM.png

When I enter these same commands to a Jupyter Notebook  (5.7.8) running in the same environment, it works, and the sphere is rendered. 

I'd appreciate any suggestions on how to fix this problem. 

Thanks,
-John

Steve Spicklemire

unread,
Apr 2, 2019, 5:17:50 AM4/2/19
to vpytho...@googlegroups.com, Steve Spicklemire
Try:

jupyter labextension install vpython

-steve

> On Apr 2, 2019, at 5:07 AM, John Burk <jb...@standrews-de.org> wrote:
>
> I've installed a VPython 7.5 using the command conda install -c vpython vpython to a clean anaconda environment running python 3.6. When I open Jupyterlab (0.35.4) and try to run a program to render a sphere, the sphere() command hangs and no window appears.
>
> <Screen Shot 2019-04-02 at 11.06.17 AM.png>
>
> When I enter these same commands to a Jupyter Notebook (5.7.8) running in the same environment, it works, and the sphere is rendered.
>
> I'd appreciate any suggestions on how to fix this problem.
>
> Thanks,
> -John
>
> --
> You received this message because you are subscribed to the Google Groups "VPython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vpython-user...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

John Burk

unread,
Apr 2, 2019, 8:16:04 AM4/2/19
to vpytho...@googlegroups.com
Thanks so much. That fixed it. 

Isabel Marie

unread,
Apr 7, 2019, 4:28:17 PM4/7/19
to VPython-users
Hi, I am having the same issue, although I am using a virtual environment running python 3.7.2. I did the commend pip install vpython (installed v.7.5.0). John's program renders in a jupyter notebook (5.7.4) but the sphere() command hangs in jupyterlab (0.35.4). I ran the jupyter labextension install vpython but the issue is still present.

Any help would be appreciated.

Thanks,
Isabel

John

unread,
Apr 7, 2019, 6:47:26 PM4/7/19
to VPython-users
Here is the documentation for working with jupyter labextensions.


Check that the vpython labextension was installed correctly with the command

jupyter labextension list

You can try uninstalling and installing it.

jupyter labextension uninstall vpython

jupyter labextension install vpython

Also according to the labextension documentation "In order to install JupyterLab extensions, you need to have Node.js installed."  

You can also try looking at the javascript console in the jupyterlab notebook and see if there are any error messages being generated.

John

Bruce Sherwood

unread,
Apr 7, 2019, 6:51:31 PM4/7/19
to VPython-users
John, is it still advisable when using Anaconda to use "conda install -c vpython vpython" instead of using pip? Would that make any difference?

Bruce

John

unread,
Apr 7, 2019, 9:15:42 PM4/7/19
to VPython-users
Bruce, I don't think it would make any difference. It was mentioned that vpython was working fine in the jupyter notebook. The vpython labextension is installed from the npm website and is not part of vpython package on conda or pip.

John

Bruce Sherwood

unread,
Apr 7, 2019, 10:19:58 PM4/7/19
to VPython-users
Ah. Understood. So now the installation instructions at vpython. org includes this:

If you use Jupyter lab, after installing VPython you need to install Node.js (https://nodejs.org/en/download/) and then execute this:

    jupyter labextension install vpython

Bruce
Reply all
Reply to author
Forward
0 new messages