I'm trying to install Django into my project using the following requirements.txt
file:
django>=4.1.0,<4.2.0
djangorestframework
pyyaml
requests
django-cors-headers
But, the following error is raised:
creating build/temp.macosx-10.14-arm64-cpython-38/lib
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Users/brendanahern/dev/drf/venv/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -c lib/zoneinfo_module.c -o build/temp.macosx-10.14-arm64-cpython-38/lib/zoneinfo_module.o -std=c99
lib/zoneinfo_module.c:1: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 backports.zoneinfo
Successfully built pyyaml
Failed to build backports.zoneinfo
ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects
I am using a Mac with an M1 chip.
Answers on a similar question suggested that the error came from numpy and I needed to install it differently due to the M1 chip, but it didn't fix the issue.