Problem getting Vpython to work with Jupyter Notebook - Help!

72 views
Skip to first unread message

Les Miklos

unread,
Jan 26, 2026, 8:47:07 PMJan 26
to VPython-users
I've spent many hours trying to get Vpython to work with Jupyter Notebook. So far no joy.
My environment:
-Jupyter 7.4.5
- Python 3.14.2
-Linux Mint
I installed Vpython using this command line      conda install -c vpython vpython     from a console session and it it appears  to be installed in the correct directory:

These are the files in the 'vpython' directory.

/anaconda3/envs/py314/lib/python3.14/site-packages/vpython

cyvector.cpython-314-x86_64-linux-gnu.so  shapespaths.py
gs_version.py                             _vector_import_helper.py
__init__.py                               vector.py
no_notebook.py                            vpython_data
_notebook_helpers.py                      vpython_libraries
__pycache__                               vpython.py
qtbrowser.py                              with_notebook.py

When I open a notebook and run these command lines :

import vpython as vp
scene = vp.canvas(width=600, height=400,title = 'VPthon Scene')
mySphere = vp.sphere(pos=vp.vector(0,0,0),radius=1,color=vp.color.red)
vp.rate(1)

This is the error message that's generated:

/anaconda3/envs/py314/lib/python3.14/site-packages/vpython/__init__.py:1: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81. from pkg_resources import get_distribution, DistributionNotFound

I'm comfortable poking around in the linux file system, editing files as necessary but I'm a relative noob when it comes to Python. I've looked everywhere online for a solution to the problem but have come up empty.  Any tips on where to look for a solution would be greatly appreciated!




Stephen Spicklemire

unread,
Jan 26, 2026, 8:53:28 PMJan 26
to VPython-users, Steve Spicklemire
I’m not sure it will help, but you may find this thread helpful:

https://groups.google.com/g/vpython-users/c/61MjceD4AxA/m/knXxGk98AwAJ
> --
> 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.
> To view this discussion visit https://groups.google.com/d/msgid/vpython-users/ea61098a-90a0-4344-bbb5-7172ebcd0c03n%40googlegroups.com.

John

unread,
Jan 27, 2026, 3:02:03 AMJan 27
to VPython-users
Try using python 3.13 or earlier, since vpython has not been updated yet for python 3.14. Since you are using conda you can create a conda environment for python 3.13 with the following command. 

     conda create -n py3.13 python=3.13 pip

where py3.13 is the name of the environment. You can choose to give it any name you want. Then activate the environment and install jupyter and vpython.

     conda activate py3.13

     pip install vpython

Then once everything is installed try running vpython in this environment.

     jupyter lab

 you might also need to install the following packages if you are using the latest jupyterlab or jupyter notebook.

    pip install brotlicffi brotli

You can list all the conda environments on your computer with the command

    conda info -e

Les Miklos

unread,
Jan 28, 2026, 8:01:02 PMJan 28
to VPython-users
Thanks guys. Your help is greatly appreciated 

I fixed one set of problems by changing my environment to 3.12 and as suggested by another user, made the warning message go away by inserting these  lines of code  at the head of the file :

import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="vpython")

from vpython import *

Volodymyr Havrysh

unread,
Feb 24, 2026, 1:05:53 PM (6 days ago) Feb 24
to VPython-users
Python 3.14.3 (tags/v3.14.3:323c59a, Feb  3 2026, 16:04:56) [MSC v.1944 64 bit (AMD64)] on win32
Enter "help" below or click "Help" above for more information.
import vpython
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import vpython
  File "C:\Python314\Lib\site-packages\vpython\__init__.py", line 1, in <module>

    from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'


вівторок, 27 січня 2026 р. о 03:47:07 UTC+2 lesjm...@gmail.com пише:

Volodymyr Havrysh

unread,
Feb 24, 2026, 1:08:21 PM (5 days ago) Feb 24
to VPython-users
Python 3.14.3 (tags/v3.14.3:323c59a, Feb  3 2026, 16:04:56) [MSC v.1944 64 bit (AMD64)] on win32
Enter "help" below or click "Help" above for more information.
import vpython
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import vpython
  File "C:\Python314\Lib\site-packages\vpython\__init__.py", line 1, in <module>
    from pkg_resources import get_distribution, DistributionNotFound
ModuleNotFoundError: No module named 'pkg_resources'


четвер, 29 січня 2026 р. о 03:01:02 UTC+2 lesjm...@gmail.com пише:

Louis King

unread,
Feb 24, 2026, 1:42:23 PM (5 days ago) Feb 24
to vpytho...@googlegroups.com
Yes, 
import warnings
warnings.filterwarnings("ignore", category=UserWarning, module="vpython")

makes the waring go away. Doesn't fix the problem.

Just sayin'



--
Lou
Say what you will about Sisyphus. He always has work.
Message has been deleted

Wayne

unread,
Feb 25, 2026, 10:37:52 AM (5 days ago) Feb 25
to VPython-users
Volodymyr Havrysh,
The issue about Python 3.14 not being feasible at this time was covered two messages up from yours by John in January, see https://groups.google.com/g/vpython-users/c/CmvRTHUrh48/m/hLDAX1zjAwAJ .
The warning about the deprecation is just that: a warning. VPython will still work at this time in modern Jupiter if you use compatible Python.
You can test it out at the 'launch binder' badges at https://github.com/vpython/vpython-jupyter/issues/284) or  https://github.com/fomightez/vpython-jupyter#vpython-working-in-jupyter-served-via-mybinder-service, where I also refer to more related discussion.

Reply all
Reply to author
Forward
0 new messages