A way to narrow down `A dynamic link library (DLL) initialization routine failed.`

dlltracer looks interesting, thank your for the suggestion.

@Flamesofshadow can you please run try dlltracer and show it’s output?

  1. Install it
pip install dlltracer
  1. Open __init__.py in installed pyradiance and replace the line
from .bsdf import spec_xyz, xyz_rgb

with

import dlltracer
import sys

with dlltracer.Trace(out=sys.stdout):
    from .bsdf import spec_xyz, xyz_rgb
  1. Then open cmd as administrator and run python -c "import pyradiance".

  2. Results I’m getting (you can try to run it multiple times, sometimes output is a bit different):

LoadLibrary C:\Windows\System32\kernel.appcore.dll
LoadLibrary L:\Software\uv\systemvenv\.venv\Lib\site-packages\pyradiance\bsdf.cp311-win_amd64.pyd
LoadLibrary C:\Windows\System32\msvcp140.dll
LoadLibrary L:\Software\Python311\vcruntime140_1.dll