Bug 512001 - Krita Next: python imports failing on MacOs
Summary: Krita Next: python imports failing on MacOs
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (other bugs)
Version First Reported In: nightly build (please specify the git hash!)
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: vanyossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-12 17:04 UTC by IPv6
Modified: 2025-11-12 18:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description IPv6 2025-11-12 17:04:32 UTC
SUMMARY

I am using python scripting with Krita extensively, and importing PIL module installed in conda env. It warked perfectly for a long time, but after update to latest Nightly build (git hash 7d99ce6) i am getting the error:

```
dlopen(/Users/ipv6/miniconda3/envs/py310_kri/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so, 0x0002): tried: '/Users/ipv6/miniconda3/envs/py310_kri/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' (code signature in <50DD719B-0D43-31F3-A5DE-F92465C8CEB7> '/Users/ipv6/miniconda3/envs/py310_kri/lib/python3.10/site-packages/PIL/_imaging.cpython-310-darwin.so' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs)
```

And imports are not working after that. This is known error with importing python modules into codesigned macos applications. It can be fixed by relaxing codesign restrictions by adding entitlement with "com.apple.security.cs.disable-library-validation", for example duckdb project made similar fix: https://github.com/opengisch/qgis-notarize/pull/3/commits/c9d2f31e05f644f720f0417d6ef5b5757b2d0943

Please, relax codesign restrictions on MacOs to allow import python modules for Krita scripting.

SOFTWARE/OS VERSIONS
macOS: Tahoe, 26.1 (25B78), Apple M2 Pro


ADDITIONAL INFORMATION
Comment 1 vanyossi 2025-11-12 18:20:21 UTC
I can confirm this issue, current nighties does not carry any entitlement.