Fastavro fatal error: 'Python.h' file not found for Mac M1
Asked Answered
C

1

6

I am trying to install fastavro on my Mac M1 laptop, but got the error:

Headers -c fastavro/_read.c -o build/temp.macosx-10.9-universal2-cpython-39/fastavro/_read.o
      fastavro/_read.c:6:10: fatal error: 'Python.h' file not found
      #include "Python.h"
               ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for fastavro
ERROR: Could not build wheels for fastavro, which is required to install pyproject.toml-based projects

My python and system info is:

Python 3.9.6
virtualenv==20.16.6
% sw_vers
ProductName:    macOS
ProductVersion: 12.6
BuildVersion:   21G115

Anyone has ideas? Thanks a lot!

Cianca answered 31/10, 2022 at 15:30 Comment(0)
I
0

Tried to overcome the same problem for fastavro==1.7.0 but without luck. Eventually changed to the latest version (pip install fastavro) and 1.8.4 version of it was installed without any issues.

Inflationism answered 10/10, 2023 at 12:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.