Warning Message to VPython Module

118 views
Skip to first unread message

Jong Wan Lee

unread,
Sep 4, 2025, 12:15:36 AMSep 4
to VPython-users
I got the following message:

-----------------------------------------------------------------------------------------------
Warning (from warnings module):
  File "C:\Users\jwlee\AppData\Local\Programs\Python\Python313\Lib\site-packages\vpython\__init__.py", line 1
    from pkg_resources import get_distribution, DistributionNotFound
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.
-------------------------------------------------------------------------------------------------

What happens after 2025-11-30 to VPython. I give a lecture with VPython this semester.
Thank you very much for help!
Jong Wan Lee from South Korea.

Bruce Sherwood

unread,
Sep 4, 2025, 2:03:59 PMSep 4
to VPython-users
Please provide a short program that illustrates the problem, and tell us what version of Python you are using.

Bruce

John

unread,
Sep 4, 2025, 5:01:04 PMSep 4
to VPython-users
I asked AI how to resolve this and here was the response

The warning indicates that the pkg_resources module, used by VPython, is deprecated and scheduled for removal by November 30, 2025. To resolve this:
  1. Update VPython: Check for a newer version of VPython that avoids using pkg_resources. Run:
    pip install --upgrade vpython
  2. Pin Setuptools: If you need to keep the current VPython version, pin Setuptools to a version below 81 to avoid the warning:
    pip install "setuptools<81"
For more details, visit the Setuptools documentation: https://setuptools.pypa.io/en/latest/pkg_resources.html.

So I don't think that there is a VPython release scheduled before November 30, 2025 so perhaps option 2 will work.

pip install "setuptools<81"

Jong Wan Lee

unread,
Sep 4, 2025, 6:54:04 PMSep 4
to VPython-users
I use the latest version of 3.13.7 of Python for Windows. But I get the same warning message for older version too.
I get the warning message immediately after I execute the following statement in the IDLE Shell mode.

>>> import vpython

Thanks.
Jong Wan Lee

2025년 9월 5일 금요일 오전 6시 1분 4초 UTC+9에 john...@shaw.ca님이 작성:

John

unread,
Sep 5, 2025, 8:28:22 AMSep 5
to VPython-users
Here is the status of Python verions
https://devguide.python.org/versions

On November 30, 2025 Python 3.14 is scheduled to be released and I guess it won't contain  pkg_resources and that is why you get the warning message. It says to  Refrain from using this package or pin to Setuptools<81.

I use Anaconda python and when I asked Anaconda to install on my computer the latest Python 3.13 release, it installed version 3.13.5 which has  setuptools version 78.1.1 . VPython did not report any problems running on Python 3.13.5. 

So I am not able to reproduce this error that you are seeing. What version of setuptools do you have in your python 3.13.7 environment? If it is greater or equal to version 81 then try pin it to  Setuptools<81 .




Jong Wan Lee

unread,
Sep 8, 2025, 1:10:09 AMSep 8
to VPython-users
Thanks for all.

I used "pip show setuptools" to get the version of setuptools.
For Python 3.13.7 and newly install vpython module, I get setuptools version 80.9.0 which is less than 81.

I applied 
pip install "setuptools<81"
and get the following message.

"Requirement already satisfied: setuptools<81 in c:\users\..."

Jong Wan Lee.

2025년 9월 5일 금요일 오후 9시 28분 22초 UTC+9에 john...@shaw.ca님이 작성:

John

unread,
Sep 8, 2025, 1:19:44 PMSep 8
to VPython-users
This is an issue with the VPython package to remove the deprecated  pkg_resources package from it's __init__.py file and replace it with the newer solution that will work with python3.13.7 and newer. So this is something that vpython will need to fix in its next release. This is just a warning message for now and vpython still works but if you don't like the warning message then you can fix the problem in the __init__.py file where the vpython package is installed on your computer. Make the __init__.py file in your vpython package installation location contain the following attached version.
__init__.py

Jong Wan Lee

unread,
Sep 9, 2025, 8:50:55 AMSep 9
to VPython-users
Thank you for the __init__.py file. I'll try it to get rid of the warning message.
But I'm worried about VPython after 2025-11-30 without a new release, whether VPython works or not in December 2025.

I newly wrote a book named "3D Physics Simulation Using VPython" in korean language and give a lecture using this book.
I use the IDLE editor and IDLE shell for all programs with imported vpython module.
If Anaconda works after 2025-11-30 then I have to change from IDLE to Anaconda and have to inform my readers and students about this problem.
I hope there will be a new release of VPython without the deprecated pkg_resources package till 2025-11-30.
Thanks.

Jong Wan Lee.

2025년 9월 9일 화요일 오전 2시 19분 44초 UTC+9에 john...@shaw.ca님이 작성:

John

unread,
Sep 11, 2025, 2:01:17 PMSep 11
to VPython-users
IDLE is Python’s Integrated Development and Learning Environment.


It comes standard with every Python release. Anaconda is an open-source distribution of the Python programming language. It contains all the released Python versions which in turn contains IDLE.

As I indicated in the status of the python versions


you can see from the diagram that if you use Python Version 3.12 or earlier with VPython then you won't get the warning message because for version 3.12 or earlier versions it is only adding security updates. I don't know when the next version of VPython will be released but a new version of VPython will be required to work with Python 3.14.X which will be released Nov 30, 2025. For Python versions 3.13.X greater than 3.13.5 then you will this warning message. So my recommendation would be to  use Python version at or below 3.13.5 or Python version 3.12  in order to not see this warning message. When Python 3.14 is released then not all the Python packages will work with it when it is released. It takes time for the python packages to be updated to be ready to work with python 3.14.

https://pyreadiness.org/3.14/

John 

Jong Wan Lee

unread,
Sep 11, 2025, 9:43:12 PMSep 11
to VPython-users
Dear John,

Thank you for the information. I have one question.

Does it mean that if I use Python 3.11 instead of Python 3.13.7, VPython works after 2025-11-30?
Then, I'll delete Python 3.13.7 and install Python 3.11 and VPython instead.

Thanks,
Jong Wan.

2025년 9월 12일 금요일 오전 3시 1분 17초 UTC+9에 john...@shaw.ca님이 작성:

John

unread,
Sep 11, 2025, 9:54:59 PMSep 11
to VPython-users
Yes if you use Python 3.12 or 3.11 or 3.10 then VPython works after 2025-11-30. 

Jong Wan Lee

unread,
Sep 12, 2025, 5:41:41 AMSep 12
to VPython-users
Thanks a lot.

Jong Wan.

2025년 9월 12일 금요일 오전 10시 54분 59초 UTC+9에 john...@shaw.ca님이 작성:

Mark Morgan

unread,
Sep 14, 2025, 7:33:40 AMSep 14
to VPython-users
Guys, to stop the pkg_resources warning just add this suppression code for now
It needs to be above the Vpython import.

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

Mark Morgan

unread,
Oct 5, 2025, 9:06:27 AMOct 5
to VPython-users
Hi everyone, I am a long time use of Vpython and I am running a simulation that consistently runs for a min or so and Awe Snap in chrome, edge and firefox. I need this to run for a long time.  any ideas to help?
Mark

Mark Morgan

unread,
Oct 5, 2025, 9:24:56 AMOct 5
to VPython-users

Hey, I updated Firefox and my vpython sim runs without crashing!
Mark
On Thursday, September 4, 2025 at 2:03:59 PM UTC-4 bruce.s...@gmail.com wrote:
Reply all
Reply to author
Forward
0 new messages