The .so file that gets created contains the python version in the filename. This all works fine if your system python version matches the python version specified in the project for uv (3.12), but if for any reason it deviates, there will be a mistmatch because the subprocess doesn't use uv and ends up using the system python version. Function found here