mac m1 compiling python packages failure

Hi all !

Just received a brand new mac M1 (macOs Monterey 12.4) with Apple chip.

I tried to install some python packages using pip, which always failed when the package need to be compiled. For example, running "pip install python-rapidjson" failed with error message: "ERROR: Failed building wheel for python-rapidjson". Also, there are lots of warnings, such as "warning: type nullability specifier '_Nullable' is a Clang extension [-Wnullability-extension]" (not sure if relevant).

I already tried the following steps:

  1. reinstall gcc.
  2. reinstall xCode and update to the last version (clang version 13.1.6).
  3. updating everything installed using brew.

Love for your help, Eylon

I had to install wheel poetry add wheel, then as wheel updated dependencies using the .lock file, I ran poetry update and this solved the problem.

By running update, poetry update dependencies, and therefor it's managing to install python-rapidjson.

mac m1 compiling python packages failure
 
 
Q