Bpy: Obscure error during Python exit on MacOS

Hi Blender dev talk.

When I import a prebuilt bpy into Python, for some reason I get the following error when Python exits.

ImportError: sys.meta_path is None, Python is likely shutting down
Error: Unknown py-exception, could not convert
zsh: segmentation fault  python3

Operating System: MacOS 10.15.6.

Python Version: python3.7.9 Python.org

How to reproduce the error:

python3 -c 'import bpy; bpy.ops.render.render(write_still=True)'

Output:

Fra:1 Mem:48.99M (Peak 49.41M) | Time:01:04.00 | Remaining:00:00.02 | Mem:1.76M, Peak:2.04M | Scene, View Layer | Rendered 508/510 Tiles
Fra:1 Mem:48.87M (Peak 49.41M) | Time:01:04.00 | Remaining:00:00.01 | Mem:1.65M, Peak:2.04M | Scene, View Layer | Rendered 509/510 Tiles, Sample 128/128
Fra:1 Mem:48.76M (Peak 49.41M) | Time:01:04.03 | Mem:1.53M, Peak:2.04M | Scene, View Layer | Rendered 510/510 Tiles
Fra:1 Mem:48.76M (Peak 49.41M) | Time:01:04.03 | Mem:1.53M, Peak:2.04M | Scene, View Layer | Finished
Saved: '/tmp/.png'
 Time: 01:04.86 (Saving: 00:00.83)

ImportError: sys.meta_path is None, Python is likely shutting down
Error: Unknown py-exception, could not convert
zsh: segmentation fault  python3

Is this normal?

Thanks in advance!

See also https://github.com/TylerGubala/blenderpy/issues/60

1 Like

I also experienced it on both Windows and Linux (I run dual boot). It is awfull as it totally breaks debugger.
So far I did not have time to report it as a bug. Did you ask on blender.chat or made a bug report on developer.blender.org?

I’ve been a bit short on time, but I just made time for it and posted this bug.

Hopefully that helps.