MacOS BigSur on M1 Macbook Air zlib not loading

Hi there!
While testing my plugins foung that zlib python module not loading on MacOs BigSur 11.1 on R23.110.
On Windows 10 same C4D version it works fine.

>>> import zlib
Traceback (most recent call last):
  File "console", line 1, in <module>
ImportError: dlopen(/Applications/Maxon Cinema 4D R23/resource/modules/python/libs/python37.macos.framework/lib/python3.7/lib-dynload/zlib.cpython-37-darwin.so, 2): no suitable image found.  Did find:
	/Applications/Maxon Cinema 4D R23/resource/modules/python/libs/python37.macos.framework/lib/python3.7/lib-dynload/zlib.cpython-37-darwin.so: mach-o, but wrong architecture
	/Applications/Maxon Cinema 4D R23/resource/modules/python/libs/python37.macos.framework/lib/python3.7/lib-dynload/zlib.cpython-37-darwin.so: mach-o, but wrong architecture
>>> 

Hi @mikeudin,

Unfortunately, there is nothing you can do on your side, we are going to look at the issue and try to resolve it as soon as possible.

Just a guess for a possible workaround (as I don't have any ARM to test stuff) is maybe to install python3.7 on your ARM mac and simply copy the zlib.cypthon-37-drawing.so.
This may cause issues due to the notarization (but it should work once you allowed the library to be loaded in your mac System preference).

EDIT: But since Python announces Big Sur support only for Python 3.9.1 it might be that there is simply no zlib ARM ready shipped if you install a Python 3.7.7 version.

Cheers,
Maxime.

Hi @mikeudin we just found out that if you enable Rosetta mode (Right click on Cinema 4D executable -> Get Info -> Check Enable Rosseta Mode) it does load also dynamically linked libraries in Rosetta Mode 🙂

This is of course a workaround and a bug report was filled in order to fix the issue as soon as possible.
Cheers,
Maxime.

@m_adam Thank you!

@m_adam same issue with bz2 and gzip modules 😔

Correct here are all the one we expect to fail:

  • bz2
  • curses
  • gzip
  • lzma
  • zlib

As a quick reminder, Python 3.7.7 doesn't officially support M1, and only Python 3.9.1 (released in December does fully support it).

Cheers,
Maxime.