I encountered these errors:
ERROR: Failed building wheel for cryptographyCould not build wheels for cryptography which use PEP 517Using legacy 'setup.py install' for cffi, since package 'wheel' is not installed.
And solved it by updating the LDSFLAGS and CFLAGS before installing any package since I'm under macOS Monterey 12.0 Beta.
env LDFLAGS="-L$(brew --prefix openssl@1.1)/lib" CFLAGS="-I$(brew --prefix openssl@1.1)/include" pip install <package>