I'm testing. I think your code is good and my 3.12 version of yesterday was good too but it does not works today with your new version and 3.12 (i did not test with 3.10 or 3.14) because of a problem on my host related to Python, i just noticed a lot of strange path that i can check bad in my my previous post too, also differents and i do not understand what is wrong on my system. Apple ships the host with python 3.9 , i installed with brew (perheaps that is part of the problem) python 3.12, then python 3.10 because it is so easy with brew. All the libs are installed with pip3.x the classic way.
The error now , still the same as yesterday before it worked ,but then also fails in my account, not even test on web engine:
Python path configuration:
PYTHONHOME = '/Users/mattei/my-env'
PYTHONPATH = (not set)
program name = 'python3'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = '/Users/mattei/my-env/lib/python3.10/python3.12'
sys._base_executable = '/Applications/Racket/bin/../DrRacket.app/Contents/MacOS/DrRacket'
sys.base_prefix = '/Users/mattei/my-env'
sys.base_exec_prefix = '/Users/mattei/my-env'
sys.platlibdir = '/Users/mattei/my-env/lib/python3.10'
sys.executable = '/Applications/Racket/bin/../DrRacket.app/Contents/MacOS/DrRacket'
sys.prefix = '/Users/mattei/my-env'
sys.exec_prefix = '/Users/mattei/my-env'
sys.path = [
'/Users/mattei/my-env/lib/python3.10/python312.zip',
'/Users/mattei/my-env/lib/python3.10/python3.12',
'/Users/mattei/my-env/lib/python3.10/python3.12/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00000001fcfee080 (most recent call first):
<no Python frame>
look at those bad paths :
stdlib dir = '/Users/mattei/my-env/lib/python3.10/python3.12'
sys.path = [
'/Users/mattei/my-env/lib/python3.10/python312.zip',
'/Users/mattei/my-env/lib/python3.10/python3.12',
'/Users/mattei/my-env/lib/python3.10/python3.12/lib-dynload',
]
a real mess.
Then i checked the previous post of mine:
/Library/WebServer/myvenv3.10/lib/python3.10/lib-dynload
did not exists , but exist
/Library/WebServer/myvenv3.10/lib/python3.10/site-packages
the same for this one yesterday or friday:
/Users/mattei/my-env/lib/python3.12/python3.12/lib-dynload
/Users/mattei/my-env/lib/python3.12/python3.12
does not exists python3.12 has been append twice.
If i solve that, for sure it will works fine.
The problem is that i do not know which code is generating those path, is it part of Python ,Racket, FFI in C ?
i have different environment, i checked the shell variable ,there is nothing that can not even confuse between 3.10 and 3.12 or melt them in the same path.
But i'm just at the beginning of my search.
update: just to see my-env is a python 3.12 vitualenv not 3.10 :
((my-env) ) mattei@mac ~ % ls -la /Users/mattei/my-env/lib/
total 0
drwxr-xr-x 3 mattei staff 96 7 nov. 11:58 .
drwxr-xr-x 7 mattei staff 224 7 nov. 12:04 ..
drwxr-xr-x 3 mattei staff 96 7 nov. 11:58 python3.12
((my-env) ) mattei@mac ~ % ls -la /Users/mattei/my-env/bin
total 120
drwxr-xr-x 18 mattei staff 576 14 nov. 12:06 .
drwxr-xr-x 7 mattei staff 224 7 nov. 12:04 ..
-rw-r--r-- 1 mattei staff 2164 7 nov. 11:58 activate
-rw-r--r-- 1 mattei staff 920 7 nov. 11:58 activate.csh
-rw-r--r-- 1 mattei staff 2195 7 nov. 11:58 activate.fish
-rw-r--r-- 1 mattei staff 9033 7 nov. 11:58 Activate.ps1
-rwxr-xr-x 1 mattei staff 208 7 nov. 12:13 f2py
-rwxr-xr-x 1 mattei staff 209 7 nov. 12:04 fonttools
-rwxr-xr-x 1 mattei staff 213 7 nov. 11:58 pip
-rwxr-xr-x 1 mattei staff 213 7 nov. 11:58 pip3
-rwxr-xr-x 1 mattei staff 213 7 nov. 11:58 pip3.12
-rwxr-xr-x 1 mattei staff 206 7 nov. 12:04 pyftmerge
-rwxr-xr-x 1 mattei staff 207 7 nov. 12:04 pyftsubset
lrwxr-xr-x 1 mattei staff 10 7 nov. 11:58 python -> python3.12
lrwxr-xr-x 1 mattei staff 10 7 nov. 11:58 python3 -> python3.12
lrwxr-xr-x 1 mattei staff 44 7 nov. 11:58 python3.12 -> /opt/homebrew/opt/python@3.12/bin/python3.12
-rwxr-xr-x 1 mattei staff 204 7 nov. 12:04 ttx
-rwxr-xr-x 1 mattei staff 230 14 nov. 12:06 virtualenv


