JUPYTERLAB VPYTHON NOT WORKING

59 views
Skip to first unread message

Somnath Chakraborty

unread,
Mar 17, 2024, 8:18:09 AMMar 17
to VPython-users
Dear Mr. Bruce,

I have installed jupyterlab-vpython from conda prompt. However, Vpython not working. following error appear. Kindly help.

Regards,

Somnath Chakraborty

======
from vpython import *

sphere(pos=vector(1,1,1))
while True:
    rate(30)
==========
--------------------------------------------------------------------------- ModuleNotFoundError Traceback (most recent call last) Cell In[1], line 1 ----> 1 from vpython import * 3 sphere(pos=vector(1,1,1)) 4 while True: ModuleNotFoundError: No module named 'vpython'









Bruce Sherwood

unread,
Mar 17, 2024, 3:12:22 PMMar 17
to vpytho...@googlegroups.com
What version of Python are you using? Note these installation instructions at vpython.org:

Using VPython with installed Python

We recommend installing the Anaconda Python distribution.

The vpython module currently works with Python versions 3.8, 3.9, and 3.10.

The 3D displays are rendered by WebGL in a browser window. For details, see
    https://vpython.org/contents/VPythonArchitecture.pdf

The vpython module is available using
     "conda install -c vpython vpython" or
     "conda install -c conda-forge vpython" or
     "conda install -c conda-forge/label/cf202003 vpython" or
     "pip install vpython"

To update to later versions of vpython use
     "conda update -c vpython vpython" or
     "pip install -U vpython"

When running from a terminal, if the program does not end with a loop
containing a rate() statement, you need to add "while True: rate(30)"
to the end of the program. This is not necessary when launching from
environments such as Jupyter notebook, IDLE, or Spyder.


We are working on a release of the vpython module that will work with later versions of Python.

Bruce

John

unread,
Mar 18, 2024, 12:27:30 PMMar 18
to VPython-users
You can see vpython working in jupyterlab in the cloud by going to this link.

https://mybinder.org/v2/gh/jcoady/vpbindercolab/HEAD

You can click on any of the demo vpython notebooks on the left menu  to open them and then run the notebooks in jupyterlab.

You will need to make sure that you have vpython installed on your computer if you want it to work with jupyterlab. Try run the command

   pip list show

or 

   conda list show

To see which version of the Jupyterlab and vpython packages you have installed on your computer. To install vpython use the command

    pip install vpython



Reply all
Reply to author
Forward
0 new messages