PyCharm / VPython message

52 views
Skip to first unread message

Louis King

unread,
May 29, 2025, 12:23:04 PM5/29/25
to VPython-users
All, I am using PyCharm 2025.1.1.1 as my IDE. And I have VPython 7.6.5 installed.
I admit I'm not sure when the following message started showing up when I run one of the graphic apps I am developing, BUT the " ...removal as early as 2025-11-30." line is scary.

Anyone else seen this? Is this a VPython thing or a PyCharm thing?

<quote>
C:\Users\User\AppData\Local\Programs\Python\Python312\python.exe C:\Users\User\PycharmProjects\Inglenook\main.py
C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\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
</quote>

Louis King

unread,
May 29, 2025, 3:50:33 PM5/29/25
to vpytho...@googlegroups.com
Thank you all for ignoring the clutter. I fixed it. It was/is a PyCharm problem. Sometime last night when I wasn't looking, the IDE configuration changed. Still some other things going on but they are not VPython related.

Lou

--
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/67913b2e-10cc-4d16-99b1-273b60925f90n%40googlegroups.com.


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

Louis King

unread,
Feb 13, 2026, 6:20:37 PM (9 days ago) Feb 13
to VPython-users
The more thing change, the more they stay the same.
I'm trying to migrate my python app from local hosting to the web and this " pkg_resources is deprecated as an API. " message is showing up again with the new host. Unfortunately it is followed by a string of other errors ending with "from vpython import *". 

Using pip3 list -V  I confirm that vpython version 7.6.5 is installed. Am I having a python configuration issue? or a vpython issue? Just trying to figure out where to start. What I think is the relevant shell log follows:
"""
[?2004XXXXXXXX [~/public_html/inglenook/simulator]# python -m main.py
[?2004l
Content-Type: text/html


/home1/XXXXXX/python/lib/python3.12/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
OpenBLAS blas_thread_init: pthread_create failed for thread 9 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 10 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 11 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 12 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 13 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 14 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 15 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 16 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 17 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 18 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
OpenBLAS blas_thread_init: pthread_create failed for thread 19 of 20: Resource temporarily unavailable
OpenBLAS blas_thread_init: ensure that your address space and process count limits are big enough (ulimit -a)
OpenBLAS blas_thread_init: or set a smaller OPENBLAS_NUM_THREADS to fit into what you have available
OpenBLAS blas_thread_init: RLIMIT_NPROC 25 current, 25 max
Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "/home1/ XXXXXX /public_html/inglenook/simulator/main.py", line 25, in <module>
    import gui
  File "/home1/ XXXXXX /public_html/inglenook/simulator/gui.py", line 12, in <module>
    from vpython import *  # imports all math functions, clock(), NOT random()
    ^^^^^^^^^^^^^^^^^^^^^
  File "/home1/ XXXXXX /python/lib/python3.12/site-packages/vpython/__init__.py", line 44, in <module>
    from numpy import arange
  File "/home1/ XXXXXX /python/lib/python3.12/site-packages/numpy/__init__.py", line 112, in <module>
    from numpy.__config__ import show_config
  File "/home1/ XXXXXX /python/lib/python3.12/site-packages/numpy/__config__.py", line 4, in <module>
    from numpy._core._multiarray_umath import (
  File "/home1/ XXXXXX /python/lib/python3.12/site-packages/numpy/_core/__init__.py", line 24, in <module>
    from . import multiarray
  File "/home1/ XXXXXX /python/lib/python3.12/site-packages/numpy/_core/multiarray.py", line 11, in <module>
    from . import _multiarray_umath, overrides
KeyboardInterrupt

John

unread,
Feb 16, 2026, 12:15:47 AM (6 days ago) Feb 16
to VPython-users
I copied and pasted your output into an AI agent prompt, namely "https://gemini.google.com/", and this was the reply. 

It looks like you're running this on a shared hosting server (like Bluehost or HostGator), and you've hit a "ceiling" on the number of processes or threads you're allowed to run simultaneously.

The Problem

The error RLIMIT_NPROC 25 current, 25 max tells us that your hosting provider limits you to exactly 25 concurrent processes/threads.

When you import vpython or numpy, the underlying math library (OpenBLAS) tries to be "helpful" by spawning 20 threads to take advantage of your CPU. Since you likely already have a few processes running (your shell, the Python interpreter itself, etc.), OpenBLAS tries to grab more than what's left of your 25-thread allowance, causing the Resource temporarily unavailable error.


The Fix: Limit OpenBLAS Threads

You need to tell Python to stop trying to use so many threads. You can do this by setting an environment variable before you run your script.

Option 1: Set it in the terminal (Immediate fix)

Run this command in your terminal before launching your script:

Bash
export OPENBLAS_NUM_THREADS=1 python -m main.py
Option 2: Set it inside your Python script (Permanent fix)

Add these lines to the very top of your main.py file, before any other imports (even before import gui or import vpython):

Python
import os os.environ["OPENBLAS_NUM_THREADS"] = "1" os.environ["MKL_NUM_THREADS"] = "1" os.environ["OMP_NUM_THREADS"] = "1" # Now you can import your other modules import gui

A Note on vPython in this Environment

The logs show you are running this in a public_html directory, which suggests a web server environment.

  • vPython is designed to open a browser window to display 3D graphics.

  • If you are running this over a standard SSH connection on a remote server, it might fail to open a display even after you fix the thread issue.

  • If your goal is to serve this as a website, standard vpython might not be the right tool for a shared backend; you might need GlowScript or a client-side JavaScript library.



So maybe this will give you some insight into your problem.

Louis King

unread,
Feb 20, 2026, 4:31:31 PM (2 days ago) Feb 20
to vpytho...@googlegroups.com
John Thank you very much! That resolved my resources issue. ~ Only one of my current problems.
Unfortunately This started as a little project to get some dynamic graphics experience ~ to apply to the "real" project. I settled on vpython for graphics and then the little exercise got bigger to include UI and a non-trivial problem to play with.

So yes the python scripts have evolved as much as been designed. Everything works fine locally under a nice IDE or called from html. A couple of months ago ego took over and I decided to make the "little graphics" app public-facing online. With about 4,000 lines of python code (and inline documentation) I'm thinking it is a bit late to re-write for tools designed for this, like Flask or  Djano, etc.

At this point I am switching hosting, to get python support, and moving up to a VPS server to get processing power & control. It has been 60 yrs since I wrote my first "hello World" BUT I am drinking from a fire hose!
Running the python app from the shell was to resolve python server issues, before addressing the call with html from a remote browser.

Thanks again John


You received this message because you are subscribed to a topic in the Google Groups "VPython-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vpython-users/2jMaYbuxC-8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vpython-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/vpython-users/3518f15b-71e3-423d-8426-88a9b8265813n%40googlegroups.com.

John

unread,
Feb 21, 2026, 5:40:41 PM (13 hours ago) Feb 21
to VPython-users
If your vpython programs are pure python and don't require other python packages then you can also consider Web Vpython. Have a look at the demo Web VPython programs at 

https://glowscript.org/#/user/GlowScriptDemos/folder/Examples/

which run in your browser. Click  Run View
 to run or view any of the demo Web VPython program listed on the above link. You can embed these webvpython programs in your web pages or html code using several different methods as explained in the  Share or export this program  link under the View option above.

John

Louis King

unread,
3:23 AM (3 hours ago) 3:23 AM
to vpytho...@googlegroups.com
To clarify where I am and where I am trying to go, I think two short videos will help explain how I got down this garden path.
I started working with a nice IDE which runs python in a browser window. With some simple system changes I got things running  locally outside of my IDE.
The short  video is 1.5 minutes, the longer one 8.5 minutes. The videos were captured on my windows system, (XAMPP/Apache), Python3.12, FireFox browser. As you can see, all works well.

My current host does not support python (in spite of their documentation). So I am migrating to a new VPS hosting. There seems to be significant  differences between Apache configuration on Windows and unix. Anyway I am having issues getting what works in one place to work in the other. Python (now) works fine, called from the shell; just can't seem to run python from php/html in a browser. 

Web Vpython is a nice tool, but I don't see how it does what I am trying to do: Host a graphics (vpython) application on my server as part of a larger project. Even looking at tools like flask or Djano I don't think they help do what I want. From what I have read they seem to make a nice package for distribution, which I have not planned on.

Steve Spicklemire

unread,
4:48 AM (2 hours ago) 4:48 AM
to VPython-users, Steve Spicklemire
Hi Louis,

I am not familiar with XAMPP, but I assume it’s a descendent of LAMP, which I do recall from the 1990s. I don’t think there should be any huge difference between how apache works between platforms, but it may take some debugging to sort out what’s happening. Having said that, I don’t think that’s really on topic for this list. Let’s carry on this conversation off-list. Maybe you can send me, at my gmail address, any apache error logs you’re still seeing on the linux side?

thanks,
-steve
> When you import vpython or numpy, the underlying math library (OpenBLAS) tries to be "helpful" by spawning 20 threads to take advantage of your CPU. Since you likely already have a few processes running (your shell, the Python interpreter itself, etc.), OpenBLAS tries to grab more than what's left of your 25-thread allowance, causing the Resource temporarily unavailable error.The Fix: Limit OpenBLAS Threads
> You need to tell Python to stop trying to use so many threads. You can do this by setting an environment variable before you run your script.
> Option 1: Set it in the terminal (Immediate fix)
> Run this command in your terminal before launching your script:
> Bash
> export OPENBLAS_NUM_THREADS=1 python -m main.py Option 2: Set it inside your Python script (Permanent fix)
> Add these lines to the very top of your main.py file, before any other imports (even before import gui or import vpython):
> Python
> import os os.environ["OPENBLAS_NUM_THREADS"] = "1" os.environ["MKL_NUM_THREADS"] = "1" os.environ["OMP_NUM_THREADS"] = "1" # Now you can import your other modules import gui A Note on vPython in this Environment
> To view this discussion visit https://groups.google.com/d/msgid/vpython-users/CAJg0VX4YgpixmBgjt6j8%2BbEQbOeq-Mf8HCZ00RVoLrOdk_9yyQ%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages