Macros issue related to distutils_hack in macOS version.


I am working on KQC project of IQM.
We are using macros of KLayout.

After installing
on my system
MacBook Pro, Apple M1, BigSur 11.6
I had an issue running any macros in KLayout (even the one, which are built-in).

The error message was: "No module named '_distutils_hack'".

I've tied to install another version of KLayout (some of 0.27.3), but and up with same error.

I bankrolled setuptools package of Klayout down to 52.0.0 version and it is fixed now.

Please, check if other Mac users have same issue.
Thank you.


  • @Vlad Thanks for reporting that problem. However, I'm not a Mac user myself. Anyone can comment here on this?

  • That how it looks like after fresh installation of
    on MacBook-Pro M1, OS:Monterey

  • Hi @Vlad,

    Thanks for reporting this problem, which I could reproduce on Catalina and BigSur (Intel Mac).
    Sorry about the inconvenience caused.
    It looks that this issue is specific to the setuptools module in the HW*.dmg packages.
    Another LW*.dmg package that shares the python 3.8 in the Homebrew, Anaconda3, or MacPorts development environment works without the problem, as shown in the attached images below.





    I've updated Homebrew's setuptools to the latest 58.3.0 and rebuilt the HW*.dmg package on BigSur. However, the result remains unchanged.
    Since I'm not the actual originator of the idea of packing the Python.framework in the DMG binary package, I need to study more about how to fix this issue.

    Warm regards,

  • Hi @Vlad,

    I could figure out the cause. :)

    Please wait for my next post.


  • Hi @Vlad,

    I have rebuilt the DMGs, which will be published by Matthias shortly.
    If you are in a hurry, you can download it from my Dropbox.
    The directory contains the first build on macOS Monterey (Intel Mac VM) as a trial.


  • Sorry, I missed this discussion ... the new DMGs are on the server.

    @kazzz Thanks for your excellent support!


Sign In or Register to comment.