Interfacing with Python - PIL import error

Hi Chris,

I am trying to run some Python code through MWorks, and am running into issues installing packages, specifically regarding the file: _imaging.cpython-39-darwin.so in the PIL package.

The issue seemed related to this one regarding ctypes, but the importlib.util solution did not work for me (gave a similar error as “have ‘x86_64’, need ‘arm64’”).

I am using Python 3.9, and have tried MWorks 0.11 and 0.12.1, running on macOS Sonoma 14.3.1. The Python script runs fine outside of MWorks. Any ideas?

Thank you!

Hi Sol,

It looks like you have an x86_64 (Intel) build of Python, but you’re trying to use it with an arm64 (Apple Silicon) MWServer process. That isn’t going to work.

The best solution would be to download and install an Apple Silicon build of Anaconda, and use that with MWorks. Alternatively, you can force MWServer to run as an Intel process via Rosetta 2. However, this does degrade performance somewhat, so the first approach is preferable.

Cheers,
Chris

1 Like

This worked, thank you!