Hi
To run a vpython program you only import vpython and not jupyterlab-vpython in your program. For instance, here is a simple 3 line program to display a box.
from vpython import *
scene = canvas()
box()
The jupyterlab-vpython is what is called a JupyterLab Extension that is used to customize and enhance JupyterLab that you only need to install one time with the command
pip install jupyterlab-vpython
See the following documentation about JupyterLab Extensions.
The JupyterLab Desktop App had this issue raised regarding extensions which is still open
but they mention that they support prebuilt extensions and jupyterlab-vpython is a prebuilt extension but it has never been tried with JupyterLab Desktop App.
As I mentioned, the JupyterLab Desktop App that you are using is NOT the official JupyterLab software and we haven't tested or tried to integrate vpython with it. I attempted to get vpython to run on JupyterLab Desktop App but I was unable to do so. You should use the official JupyterLab instead.
If you are new to vpython programing, then the easiest way to get started is with Web Vpython at
webvpython.org (
glowscript.org ) which runs in your browser. You can see and try out many demo vpython programs here.
Just click the "Run" beside any of the demo vpython programs to run them in your browser. Or click on "View" to view the source vpython code. You can create a free account at Web Vpython (
glowscript.org) so you can create your own vpython programs there and share them with others.
You can also run these same demo programs in a Jupyter Notebook as well by copying the code and replacing the 1st line of code
GlowScript 3.2 VPython
with
from vpython import *
and then running the code in a notebook cell.
Click this link to run many of these same demo programs in Jupyter Notebooks using JupyterLab on
mybinder.org.
They are the exact same code as Web VPython except the first line is replaced with
from vpython import *
for them to run in a Jupyter Notebook. So if you want to get started creating and running your own vpython programs without having to install any software then you should consider using Web VPython.