Missing python's stdlib modules in Paraview 6.1.0

I tried to use some python’s stdlib in Paraview 6.1.0, but it failed to import.

>>> import tomllib
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ModuleNotFoundError: No module named 'tomllib'

For example, tomllib is included in Python >= 3.11, and Paraview 6.1.0 uses Python 3.12.7

>>> import sys
>>> sys.version
'3.12.7 (tags/v3.12.7:0b05ead, Oct  1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]'

Is that ok?

PS: others libraries seems to be ok.

>>> import os
>>> import sys
>>> import dataclasses
>>> import argparse

Yep…that should be addressed. Is there a canonical list of stdlib modules/packages we can check against?

I’m not sure, but I run the following snippet:

import sys
import importlib
from pprint import pprint

missing = []
working = []

for name in sys.stdlib_module_names:
    try:
        importlib.import_module(name)
        working.append(name)
    except Exception:
        missing.append(name)

print("Working:", len(working))
print("Missing:", len(missing))
print("Missing modules:")
pprint(sorted(missing))

And the result is:

Working: 265
Missing: 36
Missing modules:
['_aix_support',
 '_crypt',
 '_curses',
 '_curses_panel',
 '_dbm',
 '_gdbm',
 '_posixshmem',
 '_posixsubprocess',
 '_pydatetime',
 '_pylong',
 '_scproxy',
 '_ssl',
 '_tkinter',
 'crypt',
 'curses',
 'fcntl',
 'graphlib',
 'grp',
 'idlelib',
 'msilib',
 'nis',
 'ossaudiodev',
 'posix',
 'pty',
 'pwd',
 'readline',
 'resource',
 'spwd',
 'ssl',
 'syslog',
 'termios',
 'tkinter',
 'tomllib',
 'tty',
 'turtle',
 'turtledemo']

Perhaps this could help.