If you are reading this blog, it is very likely that you’ve encountered an error caused by ibmemcached/memcached.h not found on macOS with an error message looks like:

mac fatal error: ‘libmemcached/memcached.h’ file not found #include <libmemcached/memcached.h>.

Many fellow engineers suggested to do:

brew install libmemcached brew unlink libmemcached && brew link memcached.

However, the above steps might not resolve your issues if your OS is macOS Monterey. And, if this is the case, try:

LIBMEMCACHED=/usr/local pipenv install # if you use pipenv

LIBMEMCACHED=/usr/local pip install # if you use pip